Code
BeerSpotr is made up of 2 parts:
-
The first part is a simple Ruby script that monitors Twitter for mentions of @beerspotr. It uses John Nunemaker's Twitter Gem which makes twittery stuff very easy.
Every time it finds a mention it parses the tweet to extract beer name, beer rating, brewery name, pub name, pub rating, pub postcode, image, tags, geo coordinates and the Twitter user who posted it. If it finds at least a beer name it writes the details to a MySQL database. The database schema looks like this:
-
The second part is a fairly bog standard Ruby on Rails application that sits on top of the same database and allows you to browse the spots. Which is what you're looking at now.
The only real point of interest is the plotting of multiple spots onto Open Street Map slippy maps which steals the code from this Openlayers POI layer example.
Thanks to
- James Cridland (@jamescridland) for the kindly donating the URL.
- John Nunemaker (@jnunemaker) for the fantastic Ruby Twitter Gem.
- Anthony Green (@rarepleasures) and Craig Webster (@craigwebster) for help with Ruby and Gems and stuff.
- Tom Scott (@derivadow) for the test tweets and chats.
- Neil Bramah (@neilbramah) for the spiffy design.
- Paul Clifford (#mightypaul) for the url key generation code.
- Ian Davis (@IanD) for taking time to answer dumb ass data licencing questions.
- Luke Blaney (@lucas42) for help with getting pictures out of yFrog, TwitPic etc.
- David Carrington (@davidcarrington) who also helped with the Twitter image stuff.
- Michael Nolan (@MikeNolan) for pointing out how to pull in Flickr images from a short URL.
- Jonathan Bennett (@jonobennett) for pointing me in the direction of how to plot points of interest on an Open Street Map slippy map.
- Andy Mabbett (@pigsonthewing) for making me see sense and abandon the hell of Google maps api keys for the joys of Open Street Map.
- Chris Lowis (@chrislowis) for help with OAuth.