This Python script powers @BillPedutoBot, a Twitter bot that shares the Pittsburgh mayor's public schedule with a bit of humor.
- tweet.py: Queries simple API from sister project Where's Bill, parses response and tweets latest item in schedule.
- config.py: Contains Twitter bot credential information.
- sample_data.csv: A comma-separated values file containing a January-March data dump of Mayor Bill Peduto's public schedule. Not needed to run the bot, but helpful to see the kind of stuff Bill Peduto does!
Right now, @BillPedutoBot is pretty straightforward: It tweets his schedule with a minimum of flair. It needs help from yinz to liven it up!
Things that need done:
- Expanding the parser's vocabulary, allowing it to print custom messages for different types of events on Peduto's schedule. I've made a good dent, but it still has far to go.
- Figuring out other fun things for @BillPedutoBot to tweet! Maybe an animated GIF of 'Dutes chowing down on pierogies every time his schedule mentions dinner? Just sayin!
- Anything else you think would increase the public's access to Pittsburgh's mayor and his doings. Extra points for fun.
If you have any suggestions or ideas for @BillPedutoBot not conducive to Github, shoot me an e-mail at [email protected].
To run a bot like BillPedutoBot, you will need to have:
- apache or other web server
- python enabled with that web server
-
Edit config.py to fill in your connection details.
-
Run tweet.py to have bot check if there's an event on Peduto's schedule in the next hour and tweet it.
-
Follow @BillPedutoBot and enjoy!
To keep the bot happy and well-fed, set up a cronjob to run the script every half hour or so. (Tip: Schedule it shortly before the hour, say, 1:59. This will give it time to react to events happening at 2 that it might miss otherwise.)