Search code examples
facebookmobilefacebook-fql

Is it Possible to FQL list of friends who own specific phone ?(query from wallpost source)


I've notice that each wall post from mobile phone will have something like

44 minutes ago via BlackBerry
3 hours ago via iPhone

and if we click on word "BlackBerry" or "iPhone", it'll redirect to
http://www.facebook.com/mobile/?v=6628568379 (for iPhone)
or http://www.facebook.com/mobile/?v=2254487659 (for BlackBerry)

Is there anyway we can FQL for user's friends with specific phone (or access "v" value) by using these source above ?


Solution

  • There's no way to query specifically for 'friends who use a certain device', but via the news feed you can determine this for some users

    Check out the 'stream' FQL table: https://developers.facebook.com/docs/reference/fql/stream/

    With an access_token with the read_stream permission for one of your users you can go through the posts in their news feed and check the app_id column to see which app was used to post the story. Obviously this will only surface devices for those users who've recently posted something which is visible in your app user's feed, but it's a start

    As you've noted, the mobile clients are identifiable from news feed, some of which are:

    • 6628568379 = Facebook for iPhone
    • 2254487659 = Facebook for Blackberry
    • 41158896424 = HTC Sense
    • 4620273157 = Facebook for HP webOS
    • 74769995908 = Facebook for Android
    • 135892916448833 = Facebook for Windows Phone
    • 139682082719810 = Facebook for Every Phone (java client)

    A sample query which seems to give what you want is:

    select actor_id, app_id from stream where source_id = me() limit 500
    

    The answer to this looks like:

    {
      0: {
    actor_id: <snip>,
    app_id: 74769995908,
      },
      1: {
     actor_id: <snip>,
     app_id: 6628568379,
    },
     2: {
      actor_id: <snip>,
      app_id: 6628568379,
     },  
     ...
    

    From this i can see that the first (snipped) user uses Android, and the next two use the iPhone app