Twitter Script - AymenB98/Bird-Cafe GitHub Wiki

This project had the option to write code scripting languages for web applications, so in order to post bird images to Twitter the team decided to use Python. There is a popular Python library called "Tweepy" which enables easy use of the Twitter API and can be found via the following link: https://github.com/tweepy/tweepy). Run the following command to install Tweepy:

pip install tweepy

In order for this script to work for the user, they need to setup a Twitter Developer account so that the app can authenticate their request to upload an image to Twitter (https://developer.twitter.com/en/apply-for-access). This will give the user four credentials; ACCESS_TOKEN, ACCESS_TOKEN_SECRET, CONSUMER_KEY and CONSUMER_SECRET. In order to allow the code to run on the user's machine, they must create a .txt file in the same directory as the Python script:

cd /Bird-Cafe/drivers/keys.txt

The user can now add their following information to the .txt file:

ACCESS_TOKEN
ACCESS_TOKEN_SECRET
CONSUMER_KEY
CONSUMER_SECRET

Once this is done, Tweets should be able to be made on the user's behalf.

The user needs to be careful not to share these details with anyone else, otherwise they can get access to the user's Twitter account. They should be given the same protection as a password.

*** These instructions were based off of the ones found in: https://github.com/tweepy/tweepy.