开发者

get latest status update from facebook page

How do i grab the latest status update from a f开发者_StackOverflow中文版acebook page in php? Not a users profile but a page (that you can like)? The documentation is a nightmare. Having trouble finding an answer to this!


Pages are just the same as profiles in terms of accessing them though the graph. To get the wall posts from a page you use the url https://graph.facebook.com/PAGE_ID/feed.

Adding a limit parameter will return only the most recent: https://graph.facebook.com/PAGE_ID/feed?limit=1.

Here's a quick and dirty example of how this would work in PHP:

try {
    $feed = $facebook->api('/PAGE_ID/feed?limit=1');
} catch (FacebookApiException $e) {
    error_log($e);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜