Making the Democracy Bot for @TwitterAU

One of the best things about our close relationship with Twitter is the awesome civic projects that we get to work on. For the Australian election, the head of Public Policy in ANZ, Kara Hinesley approached us and asked if we could make a simple, easy to use experience to sit behind the @TwitterAU handle.


Introducing the Democracy Bot — Twitter’s got a great write up here and you can play with the experience by clicking here (if you’re on mobile and have the twitter app or are logged into twitter in your browser).

Our Goals

The goals of the project were simple:

  • Provide a simple, easy to use way for people to find their electorate information and candidates for the House of Reps election;
  • Help users find polling places (and highlight accessible polling places);
  • Engage in the fun of the day by helping people get in contact with @DemSausage to find a sausage sizzle on the day;
  • Help share information on how people can make their vote count;
  • Share information about how voters can check the sources of their information.

We got to work.

Privacy

Twitter’s serious about privacy and we are too, so one of the core elements of this experience was not collecting any more user data than we needed. We don’t ask for addresses or specific locations because we care about user privacy — but we did wonder, given how big postcode areas can be in Australia, could we deliver a decent experience with just a postcode? You be the judge! We also aren’t storing the postcode, the postcode data is used to make the API query, we then cache the result for the user while they’re in that section of the experience and throw it away afterwards.

The Data

Australia standardsises their geographic areas with localities and postcodes and (with some exceptions) that’s open data. For the 2016 US election we built a similar informative experience using zip codes and Google’s Civic API all sitting behind the @gov handle. We weren’t as lucky with data here and had to cobble data together from a few sources to power the experience. Thankfully, the AEC makes available polling location data for the entire country (including accessibility information and proper geocoding!) as well as all candidates (well, you’d hope so).

Geo data was a bit more difficult.

The Postcode to Electorate data came from the wonderful Ben Raue, an extremely gun psephologist and all around good man (Please check out his Patreon). We also were able to rustle up some centroid data for the GIS boundaries for postcode areas (this is how we’re able to hopefully sort the polling locations by approximate proximity).

Through prototyping and testing we also decided we needed to add Google and Apple maps URLs with the data so you could find your nearest polling location then dive out to a maps app to get turn by turn directions.

Some Ruby scripts, cups of peppermint tea and a few hours later we’d turned the data into a big JSON file and wrapped a nice Typescript AWS Lambda endpoint around it, so it would easily scale out to thousands of concurrent requests (we used some webpack hackery to embed the JSON file into the Lambda zip so we didn’t have to call out to DynamoDB or similar).

The Outcome

The real star of the show is our Iris Platform, with a few hours of work we were able to build together a dynamic dialogue that hooked up to the API and powered a dynamic, performant experience. Our goal at the end of the day was a super zippy experience that helped users find out voting information, where to vote and then how to get on with their day.

Iris Dialogue
Iris Dialogue.

Let us know what you think and don’t forget to vote!


Dan Nolan

Written by

Dan Nolan CTO and Co-Founder @proxima_io
Start the conversation

Try Iris free


Sign up free, no credit card required and become one of the many companies already using Iris to build conversations.

Try Free
Already use Iris? Log in