Guest User

tweetmes.py

a guest
May 18th, 2014
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import requests
  2. from requests_oauthlib import OAuth1
  3.  
  4.  
  5. url = 'https://api.twitter.com/1.1/statuses/update.json'
  6.  
  7. app_key = ''
  8. app_secret = ''
  9. token = ''
  10. token_secret = ''
  11.  
  12. auth = OAuth1(app_key, app_secret, token, token_secret)
  13.  
  14. data = {'status':'Tweet text goes here'}
  15.  
  16. r = requests.post(url, data, auth = auth)
  17.  
  18. print(r.json())
Advertisement
Add Comment
Please, Sign In to add comment