Get posts on a friend's wall using the Facebook API

一笑奈何 提交于 2019-12-10 10:12:21

问题


I'd like my Facebook app to take the ID of the user using the app, and find posts made by that ID on the wall of one of their friends (I'd prefer an example with an individual ID rather than iterative through all friends).

I figure there's a good possibility that both users will have to provide permissions to the application to do this, and that's fine.

I would prefer posts made directly on another user's wall, as well as any comments made on the target user's status updates / own wall posts.

FQL would be preferable, but I can work with graph. I'm coding in PHP, but I can try to translate from another language if you know the solution in that.

The code I'm currently using is:

SELECT message FROM stream WHERE source_id = <FRIEND ID> AND target_id = <USER ID>

I hardcoded <FRIEND ID> to a test ID (one of the developers), and I have tried with two other <USER ID>s (also developers), all users have read_stream permission given. I'm not sure, but I thought FQL would return an error if there wasn't permission. Either way, it just comes back blank / empty.


回答1:


you will need at least the "read_stream" and the "publish_stream" of users.

Then you can select via fql. See http://developers.facebook.com/docs/reference/fql/stream/

and http://developers.facebook.com/docs/authentication/permissions/ for a list of permissions you can request.



来源:https://stackoverflow.com/questions/6318708/get-posts-on-a-friends-wall-using-the-facebook-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!