I am working on post new tweet in a web app.
what I’ve done is to post a tweet but cannot avoid pressing enter key on the requesting pin code in command line.
Here is the code: ( with tweep api, which is a python api )
CONSUMER_KEY = 'mtDrByTcXQB1zCBXGkbOWw’
CONSUMER_SECRET = 'XXXXXX’
CALLBACK_URL = ‘http://www.twitter.com/’
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET, CALLBACK_URL)
auth_url = auth.get_authorization_url()
verifier = raw_input('PIN: ').strip()
ACCESS_KEY = auth.access_token.key
ACCESS_SECRET = auth.access_token.secret
api = tweepy.API(auth)
Since i set a CALLBACK_URL, the program will redirect to my callback url, which is twitter.com, and even if i enter nothing in pin code command line, the new status can be posted.
If I try to use a oauth_verifier, I will need to get it from the webpage, which is generated after I click the AUTHENTICATE button, it will be done and the program will not act to that step before stop.
I don’t know how to avoid the pin code procedure.
Can someone help me please?
Thanks a million in advance.