How to Filter facebook friends by age using Graph API
I want to filter friends of the current user by their age. Is this possible using FQL? If so, what would the query look like?
-- EDIT --
An example of the kind of filtering im looking at is:
Find all friends between the age of 20-30
This will list your friends along with their birthdays. You can simply modify it to display pages fans:
fql?q=SELECT uid, birthday_date FROM user where uid IN (select uid2 from friend WHERE uid1=me() ) order by birthday_date DESC
var year = new Date().getFullYear(); var twentyYearsAgo = year - 20, thirtyYearsAgo = year - 30; var query = "SELECT uid FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) AND substr(birthday_date,6,10) > " + thirtyYearsAgo + " AND substr(birthday_date,6,10) < " + twentyYearsAgo";