fork download
  1. import tweepy
  2.  
  3. # https://d...content-available-to-author-only...r.com/en/docs/basics/getting-started
  4. # https://d...content-available-to-author-only...r.com/en/docs/basics/authentication/guides/access-tokens
  5. # apps.twitter.com
  6.  
  7. api_key = ''
  8. api_secret = ''
  9. access_token = ''
  10. access_token_secret = ''
  11.  
  12. auth = tweepy.OAuthHandler(api_key, api_secret)
  13. auth.set_access_token(access_token, access_token_secret)
  14.  
  15. # Construct the API instance
  16. api = tweepy.API(auth)
  17.  
  18.  
  19. print("Ostatnie tweety")
  20. public_tweets = api.user_timeline()
  21. for tweet in public_tweets:
  22. print("Tweet: ", tweet.text)
  23.  
  24.  
  25. print("Nowy tweet")
  26. api.update_status('tweepy test 2')
  27.  
Runtime error #stdin #stdout #stderr 0.04s 9292KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ImportError: No module named 'tweepy'