I will prompt users to filter their friend list in 3 ways:
- select only male friends
- select only female friends
- select all friends
for example, filter 1 will be:
SELECT name, sex, pic_big, uid FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me()) AND sex = "male"
now I need to display this information to the user! How can I show a grid or list of the resulting (filtered) friends?
Ok… First of all you’ll need :
Now, to your question.
The Graph API Explorer is a great way to get started and poke around at the API to see how you can get results. You can even run FQL queries with the Graph API.
One thing to note here is that because you are dealing with the users gender and that is not indexed in the API (that means that it can not be a search criteria), you’ll have to first retrieve the users friends and only after that make calls to retrieve each of the users gender.
With regard to displaying the information. One could use a simple method of iterating through an array of data (possibly populated by a previous call to the API) and printing out the data wrapped in
htmltags.Here is a simple example or iterating through an array and printing the contents of that array in html.