3

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.

Bart
  • 19,692
  • 7
  • 68
  • 77
SycoPrime
  • 31
  • 1
  • 2

1 Answers1

2

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.

Rufinus
  • 29,200
  • 6
  • 68
  • 84
  • Thank you for the suggestion! Er...how do I get this thing to recognize linebreaks? I tried a stream query earlier today, but wound up with an empty page. My FQL was this: `code`'SELECT message FROM stream WHERE source_id = AND target_id = ' Also, "The stream table is limited to the last 30 days or 50 posts, whichever is greater." and I was really hoping to get everything all the way back, if possible. – SycoPrime Jun 11 '11 at 22:06
  • no line breaks in comments. you will have to show some code. do you have the read_stream from both users ? its hard to tell if you need both or not, but i would say yes. – Rufinus Jun 12 '11 at 00:38