Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. import tweepy
  2.  
  3. OAUTH_TOKEN = "defined here"
  4. OAUTH_SECRET = "defined here"
  5. CONSUMER_KEY = "defined here"
  6. CONSUMER_SECRET = "defined here"
  7.  
  8. auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
  9. auth.set_access_token(OAUTH_TOKEN, OAUTH_SECRET)
  10.  
  11. api = API.GetUserTimeline(screen_name="yyy")
  12.  
  13. import twitter
  14. from twitter import *
  15.  
  16. tw = Twitter(auth=OAuth(OAUTH_TOKEN, OAUTH_SECRET,CONSUMER_KEY, CONSUMER_SECRET))
  17. tw.statuses.home_timeline()
  18. tw.statuses.user_timeline(screen_name="yyy")
  19.  
  20. >>> import twitter
  21. >>> api = twitter.Api()
  22.  
  23. >>> api = twitter.Api(consumer_key='consumer_key',
  24. consumer_secret='consumer_secret', access_token_key='access_token',
  25. access_token_secret='access_token_secret')
  26.  
  27. >>> statuses = api.GetUserTimeline(user)
  28. >>> print [s.text for s in statuses]
  29.  
  30. import tweepy
  31.  
  32. CONSUMER_KEY = 'Deliver here'
  33. CONSUMER_SECRET = 'Deliver here'
  34. OAUTH_TOKEN = 'Deliver here'
  35. OAUTH_SECRET = 'Deliver here'
  36.  
  37. auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
  38. auth.set_access_token(OAUTH_TOKEN, OAUTH_SECRET)
  39. urapi = tweepy.API(auth)
  40. me = urapi.me()
  41. print me().name
  42. print me().screen_name
  43. print me.followers_count
  44. for status in tweepy.Cursor(myapi.user_timeline,id="abby").items(2):
  45. print status.text+"/n"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement