https://github.com/nickcallaghan/twitter_api_bot
https://github.com/nickcallaghan/twitter_api_bot
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nickcallaghan/twitter_api_bot
- Owner: NickCallaghan
- Created: 2020-01-26T12:10:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-26T21:47:58.000Z (over 6 years ago)
- Last Synced: 2025-06-12T04:22:05.962Z (about 1 year ago)
- Language: Python
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twitter_api_bot
I wrote this twitter bot as a learing excercise to start to familiarise myself a little more with Python.
## Features
- Takes a seach term and finds tweets based on it
- Follow user **follow=True** by default, can be set to false in the code
- Retweet the tweet **retweet=True** by default and **min_num_to_retweet=20**
Retweet and follow options can currently only be turned off in the code. Later plan to enable args from the command line
## Setup
*This setup guide assumes you already have python 3.8 or greater installed*
1. Clone the repo and cd into it
```
git clone git@github.com:NickCallaghan/twitter_api_bot.git
```
2. Set up a virtual environment
```
python3 -m venv env
```
3. Activate the virtual environment
```
source env/bin/activate
```
4. Install dependencies
```
pip install requirements.txt
```
5. Get you own api key from [Twitter Developers](https://developer.twitter.com/)
6. Create a **keys.py** file in the root of the project and add the following keys:
```
api_key = "ADD_YOUR_KEY_HERE"
api_secret = "ADD_YOUR_KEY_HERE"
access_token = "ADD_YOUR_KEY_HERE"
access_token_secret = "ADD_YOUR_KEY_HERE"
```
7. Run the bot
```
python app.py
```