Fix SetSearchLive, SetSearchPhotos and SetSearchVideos

This commit is contained in:
Alexander Sheiko 2020-12-23 19:08:17 +02:00
parent b9ae4a1de2
commit b6887fca9c
3 changed files with 30 additions and 16 deletions

View file

@ -37,10 +37,11 @@ func (s *Scraper) FetchSearchTweets(query string, maxTweetsNbr int, cursor strin
if cursor != "" {
q.Add("cursor", cursor)
}
if s.searchMode == "live" {
q.Add("tweet_search_mode", s.searchMode)
} else {
q.Add("result_filter", s.searchMode)
if s.liveSearch {
q.Add("tweet_search_mode", "live")
}
if s.resultFilter != "" {
q.Add("result_filter", s.resultFilter)
}
req.URL.RawQuery = q.Encode()