Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Update search example
Browse files Browse the repository at this point in the history
Close #100
  • Loading branch information
n0madic committed May 20, 2023
1 parent b81d753 commit 6b7d940
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6b7d940

Please sign in to comment.