2013-03-31 21 views

回答

1

你需要给正确的GET变量的图形API,像这样:

734778xxx?fields=id,name,photos.fields(images,icon),email,posts.fields(comments.fields(message)) 

到这个页面,你自己 https://developers.facebook.com/tools/explorer

测试它。如果你需要单独的标记就可以构造东西像这样,

<?php 
require_once("facebook.php");//download & more info here https://developers.facebook.com/docs/reference/php/ 

$config = array(
    'appId' => FBAPPID, 
    'secret' => FBAPPSECRET, 
); 
$facebook = new Facebook($config); 
$fbuserid = $facebook->getUser(); 

$params = array(
"scope" => "read_stream,email,user_about_me", //here you ask for the parameters you need 
"redirect_uri" => "http://www.yoursite.com/" 
); 

//getting the info 
$user_profile = $facebook->api('/me','GET'); 
$fname = $user_profile["first_name"]; 
$lname = $user_profile["last_name"]; 
$email = $user_profile["email"]; 

?> 
+0

谢谢,罗恩,它的工作原理和我非常接近,但它需要个人令牌。我认为个人令牌会过期过了一段时间,我该如何在运行时生成它。 – donstack

+0

标记答案为接受答案plz ... – RonEskinder