2012-03-06 23 views

回答

0

我假设你没事使用第三方库,所以首先,安装tweepy

$ pip install tweepy 

othergreat Twitter的API包装在那里,但我认为tweepy可以让你使用最少量的代码对状态更新进行OAuth身份验证。只需按照示例here。我也贴吧以下要点:

#!/usr/bin/env python 

# After registering your app you should be able to 
# find these values on your application page. 
# https://dev.twitter.com/apps/{your_app_id}/show 
# Make sure your app's access level is "Read and Write", 
# or you won't be able to post. 
consumer_key="" 
consumer_secret="" 
access_token="" 
access_token_secret="" 

auth = tweepy.OAuthHandler(consumer_key, consumer_secret) 
auth.set_access_token(access_token, access_token_secret) 
api = tweepy.API(auth) 

api.update_status('Maybe you should try Googling next time!') 

我认为你的问题就不会被downvoted这么多,如果你有至少显示你有你自己取得的成就,以及什么具体的问题,你是面对。