使用用户名和密码登录Twitter OAuth(Python)

时间:2015-05-01 12:39:41

标签: python twitter oauth

所以,我要做的是使用我的Twitter凭据登录我的Twitter帐户。我知道这是可能的,我只是不知道该怎么做:/。我认为该方法与编程语言类似,但我使用的是Python。这是我使用访问令牌和消费者密钥登录的代码:

from twitter import *

token = "*******"
token_key = "******"
con_secret = "*******"
con_secret_key = "*******"

t = Twitter(auth=OAuth(token, token_key, con_secret, con_secret_key))

t.statuses.home_timeline()
t.statuses.update(status="Hello World!")

但是我想用这样的东西来做:

from twitter import *

username = "username"
password = "password"

(...)

t.statuses.update(status="Hello World!")

然后它会登录。 我怎样才能做到这一点?如果您不知道如何在Python中使用它,请用另一种语言告诉我,因为我猜它不会有太大变化。

0 个答案:

没有答案
相关问题