Skip to content

Instantly share code, notes, and snippets.

@almet
Created October 1, 2010 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save almet/606998 to your computer and use it in GitHub Desktop.
Save almet/606998 to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# coding:utf-8
import twitter_oauth
# write your oauth token and oauth token secret
consumer_key = 'cBqPWLkLtTRM2wbCqH9rIw'
consumer_secret = 'mnHm5WBv7ZAOlxKga16dRoouTA2Df9HJmtSO1H0'
# create GetOauth instance
get_oauth_obj = twitter_oauth.GetOauth(consumer_key, consumer_secret)
# get oauth_token and oauth token secret
key_dict = get_oauth_obj.get_oauth()
# create Api instance
api = twitter_oauth.Api(consumer_key, consumer_secret, key_dict['oauth_token'],
key_dict['oauth_token_secret'])
# post update
api.post_update(u'Yeah')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment