Created
March 14, 2012 23:41
-
-
Save vinigracindo/2040434 to your computer and use it in GitHub Desktop.
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 settings | |
import tweepy | |
From user_auth.models import UserSocialAuth | |
From django.contrib.auth.models import User | |
user = User.objects.get(id=10) # Suponha que existe um usuário 10 com facebook | |
oauth = tweepy.OAuthHandler(settings.TWITTER_CONSUMER_KEY, settings.TWITTER_CONSUMER_SECRET) | |
access_token = UserSocialAuth.objects.get(user = user, provider = 'twitter').extra_data['access_token'] | |
oauth.set_access_token(access_token ['oauth_token'][0], access_token ['oauth_token_secret'][0]) | |
user._twitter = tweepy.API(oauth) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment