开发者

python-Twitter-api

开发者 https://www.devze.com 2023-02-17 01:30 出处:网络
import twitter client = twitter.Api() client = twitter.Api(username=\'uname\', password=\'password\') update = client.PostUpdate(\'Tweetin from python!\')
import twitter

client = twitter.Api()

client = twitter.Api(username='uname', password='password')

update = client.PostUpdate('Tweetin from python!')

This is my code. When i execute this program i get th开发者_运维技巧is error

TypeError: __init__() got an unexpected keyword argument 'username'

Can someone help me?


take a look at this tutorial Twitter From the Command Line in Python Using OAuth


Per the documentation, you have to use OAuth, and specify keys and access tokens in the API constructor: http://code.google.com/p/python-twitter/

>>> api = twitter.Api(consumer_key='consumer_key',
consumer_secret='consumer_secret', access_token_key='access_token', access_token_secret='access_token_secret')
0

精彩评论

暂无评论...
验证码 换一张
取 消