In March, a medium-sized earthquake hit the Los Angeles area. It's not particularly uncommon, but there had been an earthquake-drought of sorts, so it warranted a write-up. The very first publication to break that story was the Los Angeles Times, thanks to a news-writing bot written bot written by Ken Schwencke, a journalist and programmer for the paper.
We're guessing that in the near future, a lot more stories will be broken by bots. It's likely that the writers of those bots won't be journalists and they won't work for traditional news publications. But it doesn't have to be that way.
There's a lot of anxiety about bots in journalism. Journalists worry that bots might take their jobs one day. They think bots are antithetical to responsible journalism. But we think bots should be about fun and exploration. Maybe someday the best bots will free the rest of us to focus on the stories that matter — the stories that use our full human faculties and require insight and judgment.
The goal of BotMaker is to make writing and deploying Twitter bots dead simple. Its target audience is journalists who might be interested in automation, but don't have the time or skills to build one from scratch.
If you can use a Google spreadsheet, you can use BotMaker and roll your own Twitter bot.
The public service use cases are easy to imagine: bots that tweet out crimes, environmental data, earthquakes. Some of these exist right now. But the very best use cases are the ones we or you haven't even thought of yet! If making a bot is easy and quick, then ideas can come to you on the fly. Do you have unused data sets waiting for a story? Maybe a bot can get that out. Are you scraping a site to gather statistics? Make use of those individual data points and feed them to your bot!
BotMaker is a work in progress, but you should be able to get a version running on your system with a little work.
-
Make a Twitter account
- We used this primer from Source for guidance. You'll need to register for an API key and copy your four authentication keys.
-
Plug in your key values on tweet.py
- Using a code editor, you need to write your own values for:
- API_KEY
- API_SECRET
- ACCESS_TOKEN
- ACCESS_TOKEN_SECRET
- Using a code editor, you need to write your own values for:
-
Load up a google spreadsheet
- Change your sharing settings so that the doc is "Public on the Web."
- You also need to "publish" your doc by hitting the "Publish to the Web" button under the "File" menu
- Get your "key" from your spreadhseet's URL. That's the number between the '=' and the '#' in this example: https://docs.google.com/spreadsheet/ccc?key=0AhjKa3sJb0yXdGpEVWJNUkZaUlRDRVZkQnlqbkZzdWc#gid=0
-
Clone a copy of the app in your desktop and run it using Python in your terminal
- BotMaker is dependent on Python and the Twython library, available here.
BotMaker is a working prototype but our team has a little more work to do:
What we need to get to a decent version 1.0:
- Clean up front end code
- Parse input strings more cleanly with proper regex
- Generate proper arrays for backend ajax call
- Rethink fake templating handlebars {{ }}--maybe variables are just words with different styling/coloring?
- Redo CSS using boostrap customization best practices
- Rethink how spreadsheet gets passed to backend--how can we deal with live data, i.e. a google sheet that changes?
- Allow for more variation in tweet formation: i.e. tweets that contain different #s of text and variables
- Allow user to input own twitter API Keys directly in the front-end
- Hook up to heroku or something so user doesn't have to run python script in terminal
Cool Future Features:
- Build some kind of web scraping into the front end
- connect to kimonolabs or other UI-based web scraping (optional Google spreadsheets proxy)
- Allow for conditional tweets (i.e. tweet only when certain values meet a condtion, or tweet different tweets for different values)
- Let bot respond to mentions
- Let bot search twitter for keywords and tweet at those accounts
- deploy to Heroku
- user inserts own Twitter account credentials and include instructions on how to obtain
BotMaker was created as part of the Reynolds Journalism Institute Social Journalism Hackathon. The team includes: