【问题标题】:how to feed pictures and videos from my wall using facebook api如何使用 facebook api 从我的墙上提供图片和视频
【发布时间】:2013-03-31 06:01:09
【问题描述】:

我正在使用 Facebook API

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

它不会从新闻提要中获取所有内容,例如图片、朋友在我的墙上分享的视频、我被标记的帖子。该怎么做?

【问题讨论】:

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


    【解决方案1】:

    您需要为 Graph Api 提供正确的 GET 变量,如下所示:

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

    【讨论】:

    • 谢谢,罗恩,它可以工作,我非常接近,但它需要单独的令牌。我认为单独的令牌会在一段时间后过期,所以我如何在运行时生成它。
    猜你喜欢
    • 2013-01-27
    • 1970-01-01
    • 2012-06-04
    • 2013-08-30
    • 2011-05-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-05
    相关资源
    最近更新 更多