Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

TanayB11/mandarin-twitter-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mandarin-twitter-bot

To never forget to tweet for Mandarin class.

Start

  1. Use pip to install the dependencies in requirements.txt
  2. Request a Twitter developer account if you don't have one
  3. Create a Twitter app and obtain your API Keys
  4. Copy this and add your API keys in a new Python file credentials.py
    consumer_key        = 'your_key_here'
    consumer_secret     = 'your_key_here'
    access_token        = 'your_key_here'
    access_token_secret = 'your_key_here'
  5. Clone this repository to your computer
  6. Navigate to the project directory
  7. Run python bot.py in the terminal (or run from a development environment)
  8. Keep the bot running even when you close the terminal by using nohup

Adjustments

  • This program takes a set of pre-written tweets from input.txt, separated by a newline
  • Enter desired tweets in input.txt
  • Go to bot.py and change time.sleep() in the for loop to your desired interval. The default is one tweet per 24hrs.

tweet-from-terminal.py is separate from the main program, and it simply allows for tweeting from the command line.

  • Follow steps 1-7 in the start guide, adjustments are not relevant (substitute bot.py for tweet-from-terminal.py in each step
  • Important: Currently only works from console, does not work in terminal

Some future improvement ideas:

  1. Allow updates to input.txt while program is running
  2. Support image tweeting
  3. If user has already tweeted today, don't have the bot tweet
  4. Use AI to get data from user tweets (or use a dataset) to generate original tweets that mimic the user

Tweepy handles OAuth and Tweeting functionality.

Here are the Tweepy Docs

Releases

No releases published

Packages

No packages published

Languages