Skip to content

Instantly share code, notes, and snippets.

@phg1024
Created April 23, 2014 00:55
Show Gist options
  • Save phg1024/11199464 to your computer and use it in GitHub Desktop.
Save phg1024/11199464 to your computer and use it in GitHub Desktop.
python twitter api test
import twitter
# == OAuth Authentication ==
#
# This mode of authentication is the new preferred way
# of authenticating with Twitter.
# The consumer keys can be found on your application's Details
# page located at https://dev.twitter.com/apps (under "OAuth settings")
C_K="..."
C_S="..."
# The access tokens can be found on your applications's Details
# page located at https://dev.twitter.com/apps (located
# under "Your access token")
A_T="...-..."
A_TS="..."
api = twitter.Api(consumer_key=C_K, consumer_secret=C_S, access_token_key=A_T, access_token_secret=A_TS)
# If the authentication was successful, you should
# see the name of the account print out
print api.VerifyCredentials()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment