Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miguelgfierro/twitter_bot
A bot that tweets automatically
https://github.com/miguelgfierro/twitter_bot
Last synced: about 1 month ago
JSON representation
A bot that tweets automatically
- Host: GitHub
- URL: https://github.com/miguelgfierro/twitter_bot
- Owner: miguelgfierro
- License: mit
- Created: 2016-01-16T07:41:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-04T08:39:53.000Z (almost 9 years ago)
- Last Synced: 2023-03-18T00:25:19.206Z (over 1 year ago)
- Language: Python
- Homepage: http://miguelgfierro.com
- Size: 7.81 KB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
A twitter bot that automatically tweets random quotes
Install twitter dependencies:
$ sudo apt-get install libffi-dev libssl-dev
$ sudo pip install -r requirements.txtCreate a new app to get the credentials at [Twitter](https://apps.twitter.com/)
Create a JSON file of user data and put into `data/botname1`:
{
"consumer_key": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
"consumer_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
"access_token": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
"access_token_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXX"
}Define your bots in `bots.conf`:
{
"bot_usernames": [
"botname1",
"botname2",
"botname3"
]
}Add your quotes to `data/quotes.json`
Cron it. Create a file called `crontab.txt` and fill it with something like this:
# Run Twitter bots everyday at 13:00
0 13 * * * /bin/bash -c 'cd /path/to/twitter_bot/src && python main.py &>> ../log/cron.log'
# Or every three hours
0 */3 * * * /bin/bash -c 'cd /path/to/twitter_bot/src && python main.py &>> ../log/cron.log'
Finally to make a cron task:
$ crontab crontab.txt
Disclaimer:I hold no liability for what you do with this bot or what happens to you by using this bot. Abusing this bot can get you banned from Twitter, so make sure to read up on [proper usage](https://support.twitter.com/articles/76915-automation-rules-and-best-practices) of the Twitter API.