- here is a tutorial I liked
- What this bot does: tweets out lines from a given text file every few minutes. It goes until it hits the end of the text file.
- here's the bot I made (I later reused this Twitter account for an department event)
- For those unfamiliar with the Vengaboys
- First you need to set up a secure way of interacting with twitter via
twitter's website for developers
- Enter the following in both code and twitter site for secure communication:
- client key/secret: identifies the service (here twitter) to your machine
- access key/secret: defines access privledges for the service on your machine, e.g. what data can/cant be accessed. Service sends this to your machine to perform any action.
- Enter the following in both code and twitter site for secure communication:
- The Python code is very minimal
- 1 line of code so user can specify text file at command prompt, ie >>python twitterbot.py stufftotweet.txt
- read in text file
- for loop iterates over each line of text file
- tweepy library makes the twitter actions simple - tons of out of the box methods for all types of twitter stuff: tweeting, favoriting, blocking, direct messaging, etc.