2

I am building a website with venues (for exaple cinemas) and i need to show to the user (user logged in with facebook) his/her friends that have checked in to this place.

I am using long, lat for my places. I am thinking of using a query that will bring the check ins from user;s friends, that are specified by a location center and a distance:

https://graph.facebook.com/search?type=location&center=38.01166,23.69272&distance=30&access_token=AAAAAAITEghMBAOL5MyxLDoFpRlirSFmEYYGZB7tHd8BH8YsUOW03uX4ewz6lVVPFWudujS0RZC7HdXm2r7OfVvnEgSr3KqRw4Q5WqlEeCNYm07XxyO

Is the query right? Is there any better way? How am i going to show to the venue page on my website, the users' profile pics?

What i realy need to create is something like this!(from tripbirds.com) but i only want to show their photo not their post on that place.

http://imageshack.us/photo/my-images/13/22811412.png/

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291

1 Answers1

1

Since each place has its own page_id, you can use the checkin table and friend table to construct a query like -

select author_uid from checkin where page_id = [PLACEID_WHERE_CHECKEDIN] and author_uid in (select uid2 from friend where uid1 = me())

And once you have the friends' id, it's simple to get their info and profile pic from the user table. If you really wanted to do it in 1 query, you could enclose the above in a query like -

select pic_square from user where uid in (ABOVE-QUERY)
deesarus
  • 1,202
  • 8
  • 10
  • Thanks for the answer, but ..i have my own venue database, facebook's place id means nothing to my site. The only thing that the place on facebook has in common with my place, is the long lat (maybe also the name but propably not exactly the same). So how am I going to tell facebook that this venue matches with that venue of your database and so bring me the check ins of friends? Thnx again – Tasos Dagkas Sep 11 '12 at 21:00
  • Ah..I see..then I have doubts about your approach as well. If you have your own venues db, then are you asking all the users to checkin via your app and choose your venue instead of the facebook check-ins ? If so, how will getting the check-in info from facbook help you ? Seems like you will have to maintain all check-ins on your end, and only do the friend lookup. And that might also not be possible if you can't get the UIDs. – deesarus Sep 11 '12 at 22:19
  • True I ll build a check in app. But I need facebook check ins also cause if none of your friends has signed up to my service, you wont see any friend check ins. Its extra info and content for my site. Any ideas? Tripbirds does this. Thank you very much – Tasos Dagkas Sep 12 '12 at 10:31