Created
April 23, 2014 00:55
-
-
Save phg1024/11199464 to your computer and use it in GitHub Desktop.
python twitter api test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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