When's the next bin pick up in your street? How do you submit a development application? Where's my closest library?
You shouldn't have to know who your local council is to have these questions answered. Tweet My Council is a simple service that works this out for you. Just use the hashtag #tmyc
, geotag your tweet and Tweet My Council will work out your local council and RT your question to them.
Tweet My Council uses the Twitter Streaming API to search for the #tmyc
hashtag. When it finds a Tweet, it uses the geo information attached to the Tweet to look up what council the person is in using the Geo2Gov service. It then queries a database to find out if the council is on Twitter (the data is crowd-sourced from a Google Doc).
If the council is on Twitter the original Tweet is RTed to the council. If the council is not on Twitter the Tweet is emailed to the council. The council can then reply to that Tweet and this is displayed on a web page and Tweeted back to the citizen.
We use TweetStream in Event Machine and Sinatra, deployed on the Heroku Cedar stack. The Geo2Gov service does the geo to local authority look up for Australia.
That's OK but it would be More Awesome if you contributed back to this and we run a global Tweet My Council service! It should be pretty easy to detect what county the tweeter is in and use a local geo-to-authority lookup service (e.g. Geo2Gov in Australia, MapIt in the UK).
C'mon, have at it!
For local development:
- Copy
configuration.yaml.example
toconfiguration.yaml
and set up your Twitter credentials - Install Rubygem dependencies:
bundle
- Run the tests!
rake
- Set up the database:
rake db:migrate
- Import data from the Google Doc:
rake db:load
- Start the server:
rackup
- Visit http://localhost:9292 to see the app
- Tweet
#tmycdev
to interact with the bot
When deploying to Heroku, you need to set environment variables for the Twitter configuration, e.g. heroku config:add CONSUMER_KEY=8N029N81
, etc.
This service would not be possible without the geo to local authority look up sevice Geo2Gov - thanks!
- Henare Degan
- Matthew Landauer
- Gavin Carr
- Katherine Szuminska
AGPL v3, see LICENSE.txt
for full details.