How can I pull the most recent city/country from a specific Foursquare account?

Go To StackoverFlow.com

0

I am trying to tie in a Foursquare account to a website, so it will return the country and city of a specific user's most recent checkin. Foursquare offers private feeds for users, using private token URL's: https://foursquare.com/feeds/ but these feeds do not include the city and country.

Is there a way that I can pull this data from the feed, or is the best way to go through the Foursquare API?

2012-04-04 19:52
by Ryan


1

You can use the feed together with Google's GeoCoding API.

From Foursquare, you get the coordinates of the last check-in(s). Then, you can use the coordinates and pass it to, e.g., Google's reverse GeoCoding API.

Sample Foursquare answer:

<item>
    <title>Geisenhausen</title>
    <description>@ Geisenhausen</description>
    ...
    <georss:point>48.46855070459905 12.259496372637319</georss:point>
</item>

Now, you can pass the coordinates to the Google API and get your city, country, etc.: http://maps.googleapis.com/maps/api/geocode/json?latlng=48.46855070459905,12.259496372637319&sensor=false

2012-04-09 13:20
by diewie
Thank you! I will give this a shot. Thanks for the help - Ryan 2012-04-09 17:06
Ads