Foursquare Auto-Checkin

Having been a recently new joiner to the foursquare phenomenon I’ve quickly decided that I like it and that it’s leaps and bounds ahead of Facebook places. That being said, it’s not without issue. The main one being that there are places I regularly frequent that I want to check into, but don’t wish to publish on twitter. “You can do that!” I hear you cry, well yes, you can, but you still have to get your phone out of your pocket.

To me, getting one’s phone out of one’s pocket should be to actually say something, such as “I’m at somewhere new” or “I’m at somewhere I normally visit but I’m here for longer this time, come and join me”. If I’m just heading to the office or going home, I want to log that onto the statistics but not shout about it. While there is of course an option on the mobile app to do this, I have to specifically choose that option. In reality, what I really want to do is only to touch my phone if I have something to say, otherwise let foursquare do the work for me.

Enter the API! I have long been a user of google latitude. This little known service allows me, via a private API key, to retrieve the latitude and longitude coordinates of my phone wherever it is. I used this feature to track my road trip progress and it worked very well. To this end, knowing that foursquare is primarily powered by coordinates and I always have access to mine, I decided to stick my coders hat on and program my way to lazy foursuare use.

Registering for a foursquare API key is easy and it arrives straight away. Getting an OAuth token using the key was also just as easy and within a minute or so I was able to call out instructions to foursquare from my server, pretending to be me. It didn’t take me long to close the loop so that to all intents and purposes my server is me as it knows where I am.

Although it’s a little rough around the edges, I now have an application running that has a pre-set list of locations that it is allowed to check me into and when my coordinates say that I am there, it calls out to foursquare and does so.

While this is far from ready for release, I do hope to do so in not too distant future, perhaps in time for WordCamp. In the meantime I’m going to sit back and enjoy ousting my colleagues as mayor of the office, just by pulling into the car park. After all, isn’t that what this whole foursquare thing is all about?

   

Possibly related articles

Leave a Comment

If you want support for Calendar then please do not post a comment or send an email. There is a dedicated forum and FAQ available for this purpose. Praise, criticism etc. about Calendar is welcome in comments on Calendar related articles.

Subscribe without commenting