From b2a9b3c7220f817244206ca53f3a3fcdd974e240 Mon Sep 17 00:00:00 2001 From: Nomadic Date: Sun, 21 May 2023 01:10:22 +0300 Subject: [PATCH] Update search example Close #100 --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 5749d3a..ab35c08 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ func main() { ### Search tweets by query standard operators +Now the search only works for authenticated users! + Tweets containing “twitter” and “scraper” and “data“, filtering out retweets: ```golang @@ -77,6 +79,10 @@ import ( func main() { scraper := twitterscraper.New() + err := scraper.Login(username, password) + if err !== nil { + panic(err) + } for tweet := range scraper.SearchTweets(context.Background(), "twitter scraper data -filter:retweets", 50) { if tweet.Error != nil { @@ -139,6 +145,10 @@ import ( func main() { scraper := twitterscraper.New().SetSearchMode(twitterscraper.SearchUsers) + err := scraper.Login(username, password) + if err !== nil { + panic(err) + } for profile := range scraper.SearchProfiles(context.Background(), "Twitter", 50) { if profile.Error != nil { panic(profile.Error)