Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.63 KB

README.md

File metadata and controls

25 lines (19 loc) · 1.63 KB

twitter_bot

Building a twitter bot

How this twitter bot works

  • 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.
  • 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.