0

I can get users check-ins with Graph API but not with FQL.

SELECT place FROM stream WHERE filter_key = 'owner' AND with_location = 'true' AND type = 285

Returns empty result.

SELECT message FROM checkin WHERE author_uid = me()

This returns very old check-ins which is like deprecated table.

How can I get FQL query to work with current users check-ins?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Boy
  • 405
  • 2
  • 9
  • 21

2 Answers2

0

Your attempt is very close. If you want to avoid returning old check-ins, add a where clause for timestamp. For example, if I want to get check-ins for myself during the last 6 months (2678400 seconds in a month), I would do:

SELECT author_uid, tagged_uids, target_id, coords, timestamp, message FROM checkin WHERE author_uid = me() and timestamp > (now() - (2678400*6))

If you want to grab checkins of friends, I would do:

SELECT author_uid, tagged_uids, target_id, coords, timestamp, message FROM checkin WHERE author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) and timestamp > (now() - (2678400*6))

Steve Veerman
  • 114
  • 1
  • 4
0

The problem here is that looks like Facebook deprecated checkin table and there are no new checkins here anymore. They started to use location_post table. So to get your checkins you may use

SELECT app_id, coords, author_uid, id, message, page_id, page_type, post_id, tagged_uids, timestamp, type FROM location_post WHERE author_uid = me()
nerowolfe
  • 4,787
  • 3
  • 20
  • 19
  • Thank you it works! Do you know how I can get placename along with checkin privacy in a single query? – Boy Feb 12 '14 at 08:32
  • You may get it in multi query like this @"'query2':'SELECT coords, app_id, author_uid, id, message, page_id, page_type, post_id, tagged_uids, timestamp, type FROM location_post WHERE (author_uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) OR tagged_uids IN (SELECT uid2 FROM friend WHERE uid1 = me()) OR tagged_uids = me()) AND timestamp > %li AND timestamp < %li'," – nerowolfe Feb 12 '14 at 09:13
  • @"'query3':'select page_id, name, type, food_styles, hours, location, categories, " "phone, pic, price_range, website, pic_big " "from page where type in (\"RESTAURANT/CAFE\", \"BAR\", \"HOTEL\", \"LOCAL BUSINESS\") and page_id in (SELECT page_id, name, " "type FROM place WHERE page_id IN (SELECT page_id FROM #query2)) '," @"}" – nerowolfe Feb 12 '14 at 09:14