User talk:Brittag

From OpenHatch wiki

Hi Brittag,

I was able to resolve the issue with help from [1] and few modifications. The Twitter APIs can henceforth be accessed only through "Registered Twitter applications". In the process of the app registration we get what are called Consumer_Key, Consumer_Secret, Access_Token_Key and Access_Token_Secret - all four of which are to be fed into the twitter.Api() method.

Registration Process:

1) Log in to Twitter Developer Site [[2]] with your regular Twitter username and password.

2) Create a new Twitter application. Few problems I faced during the registration: a)The website URL has to start with http:// b)You don't need to specify Callback URL. If you do any POST actions, you must set access to Read & Write.

3)Write down the below credentials Twitter just created for your application (you'll need them later on): Consumer key Consumer secret

4)At the end of the page there is a button - "Create my Access Token" , click on this to generate the access_token_key and access_token_secret. Once you get the confirmation that your app's access tokens have been created you can go to the "OAuth tool" tab on the same page and all your app's credentials will be listed and are to be kept confidential.

5)Now back to our sources:

In, modify the call twitter.Api() to below:

                twitter.Api(consumer_key = '<Consumer key generated above>',
                            consumer_secret = '<Consumer secret generated above>',
                            access_token_key = '<Access token key generated above>',
                            access_token_secret = '<Access token secret generated above>')

Now you should be able to successfully run: python --search=Python

and see some tweets containing the word "Python"  :)

I am yet to familiarise myself with the bug tracking system used here @ OpenHatch. So till I can do that, hope this helps.

Cheers --Divya KV (talk) 15:42, 7 August 2013 (UTC)