开发者

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

开发者 https://www.devze.com 2023-03-12 20:35 出处:网络
I\'d like my Facebook app to take the ID of the user usi开发者_运维问答ng 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 rath

I'd like my Facebook app to take the ID of the user usi开发者_运维问答ng 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.


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.

0

精彩评论

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