Cool Facebook Query Language (FQL) Queries

fql

Ari Sternberg of Facebook submits this cool query based on the newly released FQL:

Oh yeah, also, I'm curious if you guys come up with any cool FQL queries. Here's one that you might find interesting:

SELECT uid1, uid2
FROM friend
WHERE uid1 IN (SELECT uid1 FROM friend WHERE uid2=UID)
AND uid2 IN (SELECT uid1 FROM friend WHERE uid2=UID)
AND uid1 < uid2

Replace UID with the logged in user's id (e.g. 211031 for me).

This gets your whole friends map in (for me) about 5 seconds. As opposed to the many minutes that most of those friend visualization apps take using the old API and friends.areFriends.

Oh and btw, while I encourage you to try out absurd queries in the test console, please be reasonable and don't do these things in a tight loop in your program or anything. That is, you can do a big query, but don't do *too* often, or at least warn us first or something :)

I tried it in the test console and it works great.

Share and Enjoy:
  • del.icio.us
  • digg
  • NewsVine
  • Reddit
  • TailRank


Thank you for reading this post. You can now Leave A Comment (0) or Leave A Trackback.

Post Info

This entry was posted on Wednesday, February 28th, 2007 and is filed under facebook, social networking.

You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.



Previous Post: Victory Records Launches MySpace Music Player »
Next Post: Facebook Enables Photo Uploads through Platform API »

Read More

Related Reading:



Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.

forum seo