简体   繁体   中英

Facebook: How to get list of last friends checkins using graph API or FQL

The following Graph API gets the first checkin for each friend. How do you get the last checkin?

me/friends?fields=checkins.limit(1).fields(from,message,place.fields(id,name,location,likes,website,phone,description,checkins),tags)

Note that I can remove the limit but that is going to give me all the checkins which is not what I want.

I think this will be helpfull: https://stackoverflow.com/a/7743148/775109

A graph Api request for that is the following

https://graph.facebook.com/me/friends?access_token=yourToken
&fields=checkins.limit(1)&format=json&offset=0

You can try use checkin api by FQL . I see only one way: use multi query in one request:

1) select post_id from checkin table from your friends (author_uid) order by timestamp (desc)

2) select page_id from location_post table, where posts from query (1)

3) get pages info from table page where page_id is set from (2)

As result, you get last checkins, but issue: this checkins don't grouped by friends. For example, you can get last (by date) checkins, that have one user.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM