Search code examples
facebookfacebook-fql

Facebook FQL to get all status messages from an app


I am attempting to get a list of all friend messages posted by the Facebook for Android application. The Facebook for Android application has app_id=350685531728.

This returns all friend user ids:

SELECT uid2 FROM friend WHERE uid1 = $facebook_user_id

This returns all Facebook for Android postings for a user id:

SELECT message, app_id FROM stream WHERE app_id = 350685531728 AND source_id IN ($facebook_user_id)

But this returns an empty set:

SELECT message, app_id FROM stream WHERE app_id = 350685531728 AND source_id IN (SELECT uid2 FROM friend WHERE uid1 = $facebook_user_id)

Can someone tell me how to fix my query so that it works?


Solution

  • I did a bunch of testing on this. As far as I can tell there's some oddness with FQL when querying some tables. After adding a LIMIT to my status query it is returning the expected results.

    Reference: http://bugs.developers.facebook.com/show_bug.cgi?id=9639