简体   繁体   English

如何使用Facebook API从我的墙上喂养图片和视频

[英]how to feed pictures and videos from my wall using facebook api

I am using facebook API 我正在使用Facebook API

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

It is not fetching all contents from news feed like pictures, videos shared on my wall by my friends, Posts in which i am tagged. 它并没有从新闻提要中获取所有内容,例如图片,我的朋友在我的墙上共享的视频,带有我标签的帖子。 How to do that? 怎么做?

You need to give the correct GET variables to the Graph Api, like this: 您需要为Graph Api提供正确的GET变量,如下所示:

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

Go to this page and test it yourself https://developers.facebook.com/tools/explorer 转到此页面并自己进行测试https://developers.facebook.com/tools/explorer

If you need individual tokens you can construct something like this, 如果您需要单独的令牌,则可以构建类似这样的内容,

<?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"];

?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM