Email notifications for Foursquare Check-ins2011-05-20
A month or two ago a friend mentioned that Sprout Social was going to start charging her for notifications when a Foursquare user checked into the business that she managed. During the conversation it came up that she and other local businesses had a need for this sort of service. I had some time on my hands and a desire to get my hands dirty with a well-known API, so I decided to write her a script to do just that.
What I came up with was a PHP script (5.2 and up supported) designed to run as a cron task that would poll for new check-ins at a venue every 5 minutes and send an email when someone new showed up. I ended up bumping the notification interval back to 15 minutes, but there's no reason it can't support checking more often.
Later that week someone at my (semi-local) PHP User Group brought up accessing Foursquare check-in data, and I figured I might as well open source this thing. The script isn't designed with OO principles in mind or any of my other usual practices, this was just written as a (useful) proof of concept. So, without further ado, here it is: