Skip to main content

How to get detail information about facebook user

Solution to get Detailed information about facebook user.

1) First you need to log in to the Facebook Developer application:
Go to the Facebook Developer AppAfter following the link,
click “Allow” to let the Developer application access your profile.
2) Begin setting up a new application.
Go to the Developer application and click “Set Up New Application”.
Give your application a name, check to accept the Terms of Service,
then click Submit.
You’ll see some basic information about your application, including:

but for that you will need PHP client library
you can download “PHP client library” after clicking the above link.
for detail information see get started

* Your API key: this key identifies your application to Facebook.
You pass it with all your API calls.
* Your application secret:
Facebook uses this key to authenticate the requests you make.
As you can tell by its name,
you should never share this key with anyone.

code:

require_once ‘facebook.php’;
$appapikey = ‘Your API Key’;
$appsecret = ‘Your API Secrete Key’;
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();

//to get detailed information about facebook user,you can use,

$userdetails=$facebook->api_client->users_getInfo($user_id,’last_name,

first_name,sex,about_me,birthday,email_hashes,hometown_location,pic,pic_big,pic_small,pic_square,movies,music,activities,hs_i

nfo,name’);

if you would like to get user’s name and city,
then you should write
foreach($userdetails as $k){

$user_name= $k['name'];
$City= $k['hometown_location']['city'];

echo $user_name;
}

save this code in index.php and test that,what you get.

Regard
Manoj Ninave

Comments

  1. nice, its work, we don't need user to be an active application user :)

    thanks

    ReplyDelete

Post a Comment

Popular posts from this blog

Import Customers by csv file in Magento

Import Customers by csv file in Magento here i developed script to import customers in magento by csv file. csv file have following columns ########customerid (unique key) accesskey (customer type) emailaddress password firstname lastname companyname billingaddress1 city state postalcode country phonenumber faxnumber ########### here i didn't use any magento's core file. code is given below,i hope it will help you :) set_time_limit(36000); error_reporting(0); /** * @Use Script to import customer's data in Magento Database * @createDate Mar 2010 * @author Manoj Ninave (manojninave@gmail.com) **/ define("DB_HOST","localhost",TRUE); // database server name define("DB_USER","root",TRUE); // database user define("DB_PASS","",TRUE); // database user's password define("DB_NAME","dbname",TRUE); // database name require_once('db.class.php'); if( !isset($db_obj) ) {...

Magento Tables required to Import Products.

Data inserted in following tables while importing products. 1)adminnotification_inbox 2)catalogindex_eav 3)catalogindex_price 4)cataloginventory_stock_item 5)cataloginventory_stock_status 6)catalogsearch_fulltext 7)catalog_category_product 8)catalog_category_product_index 9)catalog_product_enabled_index 10)catalog_product_entity 11)catalog_product_entity_datetime 12)catalog_product_entity_decimal 13)catalog_product_entity_int 14)catalog_product_entity_media_gallery 15)catalog_product_entity_media_gallery_value 16)catalog_product_entity_text 17)catalog_product_entity_varchar 18)catalog_product_link 19)catalog_product_link_attribute_int 20)catalog_product_website 21)core_url_rewrite Regard Manoj Ninave