小编shu*_*dev的帖子

如何在带有 tweepy 的主题标签中获取所有推文?

我试图将每个打开的推文都放在一个标签中,但我的代码不会超过 299 条推文。

我还尝试从特定时间线获取推文,例如仅在 2015 年 5 月和 2016 年 7 月的推文。有没有办法在主进程中执行此操作,还是应该为其编写一些代码?

这是我的代码:

# if this is the first time, creates a new array which
# will store max id of the tweets for each keyword
if not os.path.isfile("max_ids.npy"):
    max_ids = np.empty(len(keywords))
    # every value is initialized as -1 in order to start from the beginning the first time program run
    max_ids.fill(-1)
else:
    max_ids = np.load("max_ids.npy")  # loads the previous max ids

# if there is any new keywords added, …
Run Code Online (Sandbox Code Playgroud)

python twitter tweepy tweetstream

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

标签 统计

python ×1

tweepy ×1

tweetstream ×1

twitter ×1