Python 特威比授权

Python 特威比授权,python,api,twitter,tweepy,Python,Api,Twitter,Tweepy,我学习了使用tweepy在twitter上发布内容的教程,一切正常,但我把代码给了一个朋友,让他可以使用我的twitter应用程序发布内容(使用我的凭证、消费者密钥和密码)。我的工作,因为我已经有我的访问令牌,但他如何才能得到他的访问令牌 我曾尝试使用Oauth教程,但每个示例都要求输入PIN,但我无法获得该PIN 这是我的密码 #!/usr/bin/env python # -*- coding: utf-8 -*- import tweepy, time, sys argfile = s

我学习了使用tweepy在twitter上发布内容的教程,一切正常,但我把代码给了一个朋友,让他可以使用我的twitter应用程序发布内容(使用我的凭证、消费者密钥和密码)。我的工作,因为我已经有我的访问令牌,但他如何才能得到他的访问令牌

我曾尝试使用Oauth教程,但每个示例都要求输入PIN,但我无法获得该PIN

这是我的密码

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tweepy, time, sys

argfile = str(sys.argv[1])

#enter the corresponding information from your Twitter application:
CONSUMER_KEY = 'MY TOKEN'#keep the quotes, replace this with your consumer key
CONSUMER_SECRET = 'MY TOKEN'#keep the quotes, replace this with your consumer secret key
ACCESS_KEY = '?????????????????????????'#keep the quotes, replace this with your access token
ACCESS_SECRET = '?????????????????????????'#keep the quotes, replace this with your access token secret
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)

filename=open(argfile,'r')
f=filename.readlines()
filename.close()


for line in f:
    api.update_status(line)
    time.sleep(180)#Tweet every 3 minutes

没关系,只要把callback留空,它就会给你一个PIN码

另外,通过另一个代码和PIN,我可以存储代币并在我的应用程序中使用

已解决。

获得他自己的AS/AK