Foursquare: check if a user visited a city
I was just wondering...Is it possible to check whether a specific user has checked in a specific city?
For example, if John has previously checked in at some restaurants in London and Paris, is it possible to tes开发者_C百科t from within my application if John has visited something in London or Paris?
Thanks!
Sure, within reason.
- The user authenticates via OAuth2
- You produce a number of recents to the checkin history https://developer.foursquare.com/docs/users/checkins.html - will probably need to use offset and limit to explore ALL of their check-ins
- You will want to write an algorithm to figure out what 'city' means to you - perhaps X miles within the lat/long of the city center? For more detail, use a GeoCode API such as Google's or Bing's http://msdn.microsoft.com/en-us/library/ff701713.aspx
精彩评论