小编use*_*824的帖子

Tweepy在Twitter上获取所有关注者ID

是否有可能获得拥有超过一百万粉丝的账户的完整关注者列表,例如麦当劳?

我使用Tweepy并按照代码:

c = tweepy.Cursor(api.followers_ids, id = 'McDonalds')
ids = []
for page in c.pages():
     ids.append(page)
Run Code Online (Sandbox Code Playgroud)

我也试试这个:

for id in c.items():
    ids.append(id)
Run Code Online (Sandbox Code Playgroud)

但我总是得到'超出速率限制'错误,并且只有5000个关注者ID.

python twitter tweepy

24
推荐指数
3
解决办法
3万
查看次数

如何使用oauth2为网站构建Python搜寻器

我是网络编程的新手。我想构建一个用于通过Python在Foursquare中搜寻社交图的搜寻器。通过使用该apiv2库,我有一个“手动”控制的搜寻器。主要方法如下:

def main():
    CODE = "******"
    url = "https://foursquare.com/oauth2/authenticate?client_id=****&response_type=code&redirect_uri=****"
    key = "***"
    secret = "****"
    re_uri = "***"

    auth = apiv2.FSAuthenticator(key, secret, re_uri)
    auth.set_token(code)    
    finder = apiv2.UserFinder(auth)        

    #DO SOME REQUIRES By USING THE FINDER
    finder.finde(ANY_USER_ID).mayorships()
    bla bla bla
Run Code Online (Sandbox Code Playgroud)

问题是,目前,我必须在浏览器中键入URL,并从重定向URL中获取CODE,然后在程序中更新CODE,然后再次运行它。我认为可能会有一些方法可以对CODE进行编码,从而使当前程序有所进展并使其自动化。

任何指令或示例代码表示赞赏。

python api web-crawler foursquare oauth-2.0

5
推荐指数
1
解决办法
3131
查看次数

标签 统计

python ×2

api ×1

foursquare ×1

oauth-2.0 ×1

tweepy ×1

twitter ×1

web-crawler ×1