Skip to content

Foursquare API/Geolocation Demo

I created a quick demo to show how you can use the Firefox’s HTML5 geolocation features and a Foursquare API Wrapper to find stuff around your current location. In short: I made a web app that allowed me to find bars, without having to pull out my cell phone. Now you too can inconspicuously look for bars whilst on your laptop.

I used some demo HTML5 code to get the geocoded location in Firefox greater than 3.5. I’ve seen some mixed results and some errors using this, so any feedback on issues found would be appreciated. Of course, you can just manually enter your zipcode if you would like to try this on a non-HTML5 compliant browser, or would like to look up stuff in an area you are not in currently. Pretty simplistic demo, and I’ll add more features/fix bugs in later versions.

I used the PHP wrapper classes Async Foursquare API to interact with the Foursquare API. This sped up time greatly, and I would highly recommend using it as it does offer OAuth functionality as well. Also used the Google Map API to geocode the entered zipcode. The foursquare API requires you pass latitude and longitude to get venues in an area, and this was a quick work around. Of course this demo also uses JQuery, but everyone is (or should be) using it now.

All content is generated from foursquare’s data, and I take no responsibility for the venues that are displayed. What you see is whats on foursquare, and this may be the good interface for finding foursquare venues to close or edit.

I will have links to the code soon, and will add them to this post. Any feedback is appreciated.

Link to the demo

[Updated] – Heres the sources for demo. Update the ‘test.php’  AJAX file with your own Google Maps API key, and download/extract Async wrapper classes into directory to host this locally: 4sq.tar.gz

Post a Comment

You must be logged in to post a comment.