1

有没有办法从 facebook 检索更多帖子?我正在开发一个需要从 facebook 检索至少 200 个帖子的网站。现在我只收到 24 个帖子。有可能获得200个帖子吗?

 $user_posts = json_decode(@file_get_contents(
           'https://graph.facebook.com/me/posts?access_token='.$access_token));
$user_posts = (array)$user_posts;
$user_posts = $user_posts['data'];
echo "<h1>Posts</h1>";
foreach($user_posts as $user_post){
    $user_post = (array)$user_post;

    echo "<table border='8' width='500'>";
    if(($user_post['picture'])||($user_post['message'])){
        echo "<tr>";
        echo '<td height="4"></td>';
        echo "<td>";
        if($user_post['message']){
            echo "<tr><td>Message : ".$user_post['message']."</td></tr>";
        }
           }
    }

谢谢。

4

1 回答 1

1

我找到了这个答案。只需在 url 中添加一个限制字段。

$user_posts = json_decode(@file_get_contents('https://graph.facebook.com/me/posts?access_token='.$access_token.'&limit=200'));

于 2011-07-06T20:22:53.130 回答