我试图将每个打开的推文都放在一个标签中,但我的代码不会超过 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)