Let's make a Twitter bot (or two!)
- Fork this repository to your GitHub account
- Clone the forked repository on your computer's Desktop
- cd into that directory (
cd twitterbot
) virtualenv bot
- OSX:
source bot/bin/activate
| Windows: pip install -r requirements.txt
- open your tweetbot folder in a text editor (TextWrangler/Notepad++)
- Create a new Twitter account (give it your mobile phone number - sorry.)
- Create a Twitter app by clicking on "Create New App"
- Fill out the necessary details for your bot’s name, description, and website (use your repo URL) and don’t worry about "Callback URL".
- Agree to the checkbox for “Terms of Service” and click on "Create Your Twitter Application."
- Click on the "Keys and Access Tokens" tab.
- Modify the app permissions to have it be able to read and write.
- Click the button that says "Regenerate Consumer Key and Secret"
- Click the "Create my access token" button
- Switch back to your text editor
- Copy your Consumer Key, Consumer Secret, Access Token and Access Token Secret in that order to the places in
tweetbot.py
andtweetbot2.py
. - In
tweetbot2.py
, changepropublica
to a search term you'd prefer. - Save both files.
- Run
python tweetbot.py
- Check your twitter page
- Run
python tweetbot2.py
- Open
data.csv
in the same directory.