views:

69

answers:

1

I am using this code to get the userInfo

    twitter = oauthtwitter.OAuthApi(CONSUMER_KEY, CONSUMER_SECRET, access_token)
    try:
        userinfo = twitter.GetUserInfo()
    except:
        # If we cannot get the user information, user cannot be authenticated
        return None

    screen_name = userinfo.screen_name
    user, created = User.objects.get_or_create(username=screen_name)

here I am not able to get the email Id of the user so use another way that is tweety

    import tweepy
    auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
    auth.set_access_token("xxxxxxxxx", "yyyyyyyyyyyyyyy")
    api = tweepy.API(auth) 

Its also give me the same hash data and didnt provide me the email id of the user

Could any one please help me to get the Email id of the twitter user in Django app .

Thanks

Ansh J

+1  A: 

Twitter's API does NOT give out the user's Email ID. This is by design.

(Side note: I had a similar requirement and found this out myself earlier)

Manoj Govindan
Does there any other way to get user's email id on twitter ?
Ansh J
As far as I know there is no automated/API way to do this. You will have to ask the user :)
Manoj Govindan
Thanks manoj Govindan
Ansh J