Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使用tweepy在两个给定日期之间收集大量推文?_Python_Json_Api_Tweepy_Tweets - Fatal编程技术网

Python 如何使用tweepy在两个给定日期之间收集大量推文?

Python 如何使用tweepy在两个给定日期之间收集大量推文?,python,json,api,tweepy,tweets,Python,Json,Api,Tweepy,Tweets,例如,从6月1日到今天,我想每天收集20条推文,但现在我只能查看今天最近的20条推文 def get_tweets_and_tones_json(searchTerm, NoOfTerms): output = [] geo = "21.1498134,79.0820556,1045km" start_date = datetime.date(2020, 6, 1) end_date = datetime.date.today() tweets = tw.Cursor(ap

例如,从6月1日到今天,我想每天收集20条推文,但现在我只能查看今天最近的20条推文

def get_tweets_and_tones_json(searchTerm, NoOfTerms):

output = []
geo = "21.1498134,79.0820556,1045km"
start_date = datetime.date(2020, 6, 1)
end_date = datetime.date.today()
tweets = tw.Cursor(api.search,q=searchTerm,count=NoOfTerms, geocode=geo,lang='en', 
                    since= start_date,until = end_date).items(20)
for i,tweet in enumerate(tweets):
    tweetedText = tweet.text
    
    jsonFile1 = analyze_tone(tweetedText)
    x = tweet.created_at
    print(tweetedText,'\n', x)

请将您的帖子设置为即使没有标题也有意义。使用公共API,您无法搜索超过6-9天的帖子(来源:),请将您的帖子设置为即使没有标题也有意义。使用公共API,您无法搜索超过6-9天的帖子(来源:)