We grew up moving in Public Transit and have spoken with more than 1000 fellow commuters who use it on a daily basis. Most of these conversations are based on one thing, complaints. And we believe that well directed complaints can drive change. So we decided to better the reach of our users report section with the push of Twitter’s APIs.
What it does
We built a Twitter bot that tweets every time a user reports some public transit incident. This will drive more dialogue around this with other citizens and with authorities and politicians that are also on Twitter.
We currently guide 600K users to commute in Lima Peru, a city with more than 9 million public transit riders every day and we think empowering them with these tools will be great for our city.
How we built it
The reports section in the TuRuta App was built with android native code (Java) and it uses Firestore collections as a database.
We set up a Firebase Function that is triggered when a new report is created from the TuRuta App.
Inside the Firebase Function we read the report information, do some basic filtering (to filter out unwanted reports like spam) and then use the Twitter API v2 to post a tweet to our official TuRuta Reports twitter account.
We used Oauth 2.0 with the offline.access permission for authenticating our Twitter account and so the bot can post on behalf of it. For handling the connection to the Twitter API we used this library.
Challenges we ran into
We had a misconfiguration of URLs during the Oauth 2.0 process but thanks to the twittercommunity.com forum we sorted it out.
Accomplishments that we're proud of
We are very happy with how seamlessly we integrated this into the User Experience flow and the fact we could integrate user interviews and customer development in such quick time.
What we learned
Twitter API v2 is very mature and has a great community and tooling behind. We talked to some users about this release and they were very excited. We also gauged interest with some transit Twitter influencers and they are looking forward to reading what the city is experiencing and pushing change directly, and very excited about tagging authorities.
What's next for TuRuta - ReportBot
We would like to allow users to include pictures, we understand this may require more filtering and for that we believe we can build a robust community of moderators. We also want to start trying with formats that make it easier for users to write what they want in just 130 characters, which is currently being an issue for the tweeting and we believe this is crucial not only for the tweeting but for making their messages more clear for anyone reading. We are also very interested in helping users easily tag authorities directly when writing the reports inside TuRuta and making it show up in Twitter. We are very excited about the community aspects this synergy can drive and look forward to them.