1

I am trying to leverage the python-twitter wrapper to convert email addresses to twitter username. So far I am trying to the code below but getting an error that states "Sorry, that page does not exist code 34". I am using the latest version of python-twitter and valid keys/secret to access (other python-twitter scripts are working OK).

Here is what I have:

import twitter
api = twitter.Api(consumer_key='',
                          consumer_secret='',
                          access_token_key='',
                          access_token_secret='')
users = api.GetUserByEmail('testemailaddress123@gmail.com')
for name in users:
    print name

This code is based off the python-twitter documentation at: http://static.unto.net/python-twitter/0.6/doc/twitter.html#User

Cœur
  • 37,241
  • 25
  • 195
  • 267
AAA
  • 2,388
  • 9
  • 32
  • 47

1 Answers1

0

It seems like python-twitter is still using twitter's v1 API, which is being retired on May 7th, 2013. Today, April 16th 2013, Twitter is performing a blackout test in preparation of the deprecation of v1.

You should use Twitter's v1.1 API instead. I believe the following will work for the python-twitter client (haven't tested it).

api = twitter.Api(consumer_key='',
                      consumer_secret='',
                      access_token_key='',
                      access_token_secret='',
                      base_url='https://api.twitter.com/1.1')

EDIT: It seems like there is a v1.1 branch of the python-twitter client, which can be found here.

FastTurtle
  • 2,301
  • 19
  • 19
  • Thank you for the follow-up but looks like this still isnt working... I think the issue is context based with the Python code based on the error... – AAA Apr 17 '13 at 00:20
  • Looks like this feature might have been canned: https://dev.twitter.com/discussions/612 – AAA Apr 17 '13 at 00:48