开发者

Graph API - Get latest news feed entries instead of "top news"

开发者 https://www.devze.com 2023-04-02 11:41 出处:网络
I\'m working on a module to my web application which is supposed to display latest news feed entries for a specific user.

I'm working on a module to my web application which is supposed to display latest news feed entries for a specific user.

I was wondering if it's possible to add a certain "orderby" parameter to the graph api url in order to fetch the "latest news" instead of facebook's default "top news" which arranges the order using popularity and other elements.

I'm currently using the following url:

ht开发者_如何学Gotps://graph.facebook.com/me/home?access_token=...&limit=10

but again, this does not return the latest entries.

Does anyone know how to solve this?


You can use FQL rather then Graph to query the "stream" table. FQL supports order by statements similar to SQL. http://developers.facebook.com/docs/reference/fql/

For your specific example it would be

SELECT post_id FROM stream WHERE source_id=me() ORDER BY updated_time DESC

Obviously you will want to query more then just the post_id, you can find the full list of fields here http://developers.facebook.com/docs/reference/fql/stream/


Mikey, I've been trying to do the same thing. During my tests I found that the Facebook API didn't return all the entries it was supposed to.

Meaby in some way it's prevent you from seeing all updates correctly.

Try this :

In your browser open : https://graph.facebook.com/me/home?access_token=

then

Go to the Facebook Graph API Doc : https://developers.facebook.com/docs/reference/api/ and click the News feed: https://graph.facebook.com/me/home?access_token=... link in the page.

Check if the two page show the same output.

0

精彩评论

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