Project of Becky Boone and Drew during our fellowship at Code for America in 2014.
A twitter bot that pulls data from Adopt-A-Pet-Denver an API created by David Viramontes and Drew to serve data for animals currently in Denver animal shelters ready for adoption.
Links to API and Bot
The command in your terminal should look something like this:
git clone https://github.com/drewrwilson/CutiesInDenver.git
cd CutiesInDenver
bundle install
You need to sign up for a twitter API. You'll need all of the following:
- consumer key
- consumer secret
- access token
- access token secret
If you're using a Mac or Linux, you can do this in bash by running these commands:
export consumer_key=XXXXXXXXXXXXXXXXXXXXXX
export consumer_secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
export access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
export access_token_secret=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Alternatively, you can set those properties in a file named ".env". The example file, template.env, can be renamed to .env and modified.
Running rake
from the project directory should result in tweeting about a random adoptable pet.
Hat tips
-
Kudos to Darius for his great guide on how to make a twitter bot.
-
And kudo to Erik for the twitter gem.