Civic Hacking and Twitter Bots

I recently started my first experiment with civic hacking.  For those not familiar, the concept of civic hacking is basically creating some sort of tool that complements or supplements the services of government.  That is a simplification, but it encompasses the basic idea.

The idea appeals because if what you build works, then your fellow citizens benefit.  And the cost, especially relative to the government creating the same thing, is miniscule.

Carnegie would be proud (probably)

The idea was born out of a pretty cool program that Chicago’s public libraries run.  If you have a library card, you can get passes to local museums that either reduce the price, or in most cases, allow free entry for a family with children.  Considering the cost of admission can be upwards of $30, this can be a significant value for library card holders.

There are two related problems that, in my opinion, reduce the effectiveness of the program.  First, passes are either ‘Available’ or ‘Due’ at some future date.  But the due date may not be when they are in fact returned, which makes it difficult to plan ahead.  And given that there are a limited number (1 to 2 per museum per branch), it sort of becomes a lottery whether the pass you want is available when you go.

The second problem is that while the library site does show availability, it’s a somewhat byzantine process to find it.  You could bookmark the pass you want, but even still, you will have to scroll through a list of every branch to find your local location.

In short, the difficulty of finding availability is likely dampening the number of people that are able to take advantage of the program.

Enter the bots

So I did what any good hacker would do, I automated a way to disperse availability notifications more easily.

The first step was to create a robot that would open up the unique url for each pass in a browser window and read the availability information for each branch.  Selenium proved up to the task.

The next step was to create a database to compare the most recent status with the current status read from the browser.  (I actually ended up just creating a local text file to store the most recent statuses, but I do store each lookup to the database).

The final step was to create a twitter bot to post updates.  That way, instant notifications are available to anyone interested in knowing when a given pass becomes available.

So, does it work?

The system has been up and running for a few hours now, and I was pleasantly surprised to see that the tweets were garnering impressions.  From who?  I don’t know.  Are they people who want to use these passes?  Not sure.

Time will tell whether people start to follow the bot.  It may be that having a bot for each pass or each branch might be more effective since most people probably don’t care about pass activity at 95% of the Chicago library branches.

But for now, it’s cool to have an automated bot spewing (hopefully) useful notifications out into the Chicago ether.

Leave a Reply

Your email address will not be published. Required fields are marked *