Skip to content

Instantly share code, notes, and snippets.

@acoomans
Created February 24, 2013 02:52
Show Gist options
  • Save acoomans/5022370 to your computer and use it in GitHub Desktop.
Save acoomans/5022370 to your computer and use it in GitHub Desktop.
Quickstart for authenticating and sending a message using python _twitter_oauth_.
# http://pypi.python.org/pypi/twitter_oauth/0.2.0
# pip install twitter_oauth
import twitter_oauth
print "remember to leave callback blank in twitter settings!!"
consumer_key = 'CONSUMER_KEY'
consumer_secret = 'CONSUMER_SECRET'
get_oauth_obj = twitter_oauth.GetOauth(consumer_key, consumer_secret)
get_oauth_obj.get_oauth()
import twitter_oauth
import sqlite3
import re
oauth_token = 'OAUTH_TOKEN'
oauth_token_secret = 'OAUTH_TOKEN_SECRET'
consumer_key = 'CONSUMER_KEY'
consumer_secret = 'CONSUMER_SECRET'
api = twitter_oauth.Api(consumer_key, consumer_secret, oauth_token, oauth_token_secret)
api.post_update(tweet=u'Hello, Twitter')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment