LobbyTracker: Single Day Hackathon

If you’ve never taken a look at the SF Open Data API, you should. The San Francisco city government has done a fantastic job putting a plethora of information online. The only unfortunate part? Scouring the data tables isn’t exactly user friendly.

Using this API has become a classic Bootcamp project, and that is exactly what Viking Code School tasked us with this past week. We were asked to look through the available information and brainstorm a project that we would be able to build in a day. After searching through the available information I decided to use a couple different data tables revolving around city officials and lobbyist. I was able to use this information to create a Ruby on Rails application that displays meetings between city officials and lobbyists, as well as information about lobbyist firms, lobbyist firm clients, and campaign contributions.

The central challenge of this project was finding a way to organize the information. I was tapping multiple data tables and had to have them integrate seamlessly. I could have pulled all the data I needed and persisted it to a database, but that seemed against the spirit of the project. I decide to build factor ActiveRecord style models and methods to interact with the various data-tables I would need. All models inherited from a parent that contained common information and methods, such as building a client to use the API gem.

The parent object, SodaRecordsMain, also had access to a module with methods used for building queries to submit to the database.

In the end the project was a success. I was able to complete core features on time and even add the slightest bit of styling. If you live in San Fransisco and are wondering what your city officials are up to, check out the deployed project here.

You can also view all of my code on Github.