如何使用facebook api从我的墙上提供图片和视频

时间:2013-03-31 06:01:09

标签: asp.net facebook facebook-graph-api

我正在使用facebook API

https://graph.facebook.com/PAGE_ID/feed?access_token=ACCESS_TOKEN

它不会从我的朋友在我的墙上分享的图片,视频等新闻Feed中获取所有内容,我在其中标记了帖子。怎么做?

1 个答案:

答案 0 :(得分:1)

您需要将正确的GET变量提供给Graph 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"];

?>