Hide
Search Results

Getting Profile Information

This example uses YQL to get a user’s profile information, including their guid, gender, given name, image and location.

YQL table: social.profile

Setting Up this Example

  1. Start by going to the My Apps page and Click “Create New App”.

Note: If you are not already logged in to Yahoo!, you will be prompted to log in or create a new Yahoo! account.

The Create New App page appears.

Create Profile App
  1. Fill in the fields as follows:

    • App Title: Enter “Profile App”.

      This is the title of the App as it will appear in the Galleries.

    • App Content: Select “External”.

    • App Content URL: Enter the hosted URL “http://www.yap-apps.com/sample/userinfo.php

    • User Signin: Select “Required”.

    • HTTP Method: Select “GET”.

    • Dimensions: Enter “960” for Width, and “600” for Height. This is the default.

    • Description: Enter “Get Profile Information”

      This is the description of your app Gallery as it will appear to users.

  2. Click the “Create App” button. The Edit App page appears.

  3. Click Save.

  4. Click Preview.

The Preview page appears:

Preview Profile App

Hosted PHP file

<?php
$lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : '';
$ctry = isset($_REQUEST['country']) ? $_REQUEST['country'] : '';
if($lang != '' && $ctry != '') {
	$str = "Your selected language code is <span>$lang</span> and Country code is <span>$ctry</span>";
}else {
	$str = 'We are not able to retrieve your information';
}
?>
<html>
  <head>
    <style>
      h1{
        color:red;
        font-weight:normal;
       }
       h1 span{
         color:black;
         font-weight:bold;
       }
    </style>
  </head>
  <body>
    <h1>
      <?php echo $str;?>
    </h1>
  </body>
</html>

Table of Contents