therealnemis

Twitter Bot

Jan 14th, 2018
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. https://apps.twitter.com/
  2.  
  3. Go into command line
  4.  
  5. pip install --upgrade pip
  6. pip install tweepy
  7.  
  8. create new python file
  9.  
  10. python file
  11. -----------
  12.  
  13. import tweepy
  14.  
  15. consumer_key = ''
  16. consumer_secret = ''
  17. access_token = ''
  18. access_token_secret = ''
  19.  
  20. #OAuth and integrate with API
  21. auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
  22. auth.set_access_token(access_token, access_token_secret)
  23. api = tweepy.API(auth)
  24.  
  25. # Write a tweet to push to our Twitter account
  26. tweet = 'Hello, world!'
  27. api.update_status(status=tweet)
Advertisement
Add Comment
Please, Sign In to add comment