Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

什么时候出获取following和followers的功能啊大佬 #2

Open
VarusJ opened this issue Nov 18, 2019 · 1 comment
Open

什么时候出获取following和followers的功能啊大佬 #2

VarusJ opened this issue Nov 18, 2019 · 1 comment

Comments

@VarusJ
Copy link

VarusJ commented Nov 18, 2019

等着学呢~

@Solin1998
Copy link
Owner

Solin1998 commented Nov 21, 2019

等着学呢~
可以用twitter自带的API,我给一段代码给你你自己运行一下

import tweepy
consumer_key = 'DpFGRdAxcCWxFvekPp7FfwLxt'
consumer_secret = 'QnnyJklsVZAFesw2Prz8U76SDCCGFOL8iTcUUUkZNxPtInEfbq'
access_token = '3388759955-eftryjXcA1NfHWXyAUYuvchvGcfXgfoSEaD5zBE'
access_token_secret = 'n004TBpZXI1QOKH5HCdNZFUDIDO3c6L'
auth = tweepy.OAuthHandler (consumer_key, consumer_secret)
auth.set_access_token (access_token, access_token_secret)

#我改了一下 你自己注册啊..
api = tweepy.API(auth)
api = tweepy.API(auth, wait_on_rate_limit=True)

results=api.friends(id=user_id) #user_id就是@后面的内容,唯一识别id,可以爬到follwing和followers



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants