Code

BeerSpotr is made up of 2 parts:

  1. 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:

    BeerSpotr database schema
  2. 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