Fix search query escape

Close #57
Close #58
This commit is contained in:
Alexander Sheiko 2022-05-02 12:30:05 +03:00
parent fd13d434b5
commit 6bf6dc4b69

View file

@ -2,7 +2,6 @@ package twitterscraper
import ( import (
"context" "context"
"net/url"
"strconv" "strconv"
) )
@ -28,7 +27,6 @@ func SearchProfiles(ctx context.Context, query string, maxProfilesNbr int) <-cha
// getSearchTimeline gets results for a given search query, via the Twitter frontend API // getSearchTimeline gets results for a given search query, via the Twitter frontend API
func (s *Scraper) getSearchTimeline(query string, maxNbr int, cursor string) (*timeline, error) { func (s *Scraper) getSearchTimeline(query string, maxNbr int, cursor string) (*timeline, error) {
query = url.PathEscape(query)
if maxNbr > 50 { if maxNbr > 50 {
maxNbr = 50 maxNbr = 50
} }