add scrap tweets for any search query feature
This commit is contained in:
parent
37bb62a82a
commit
2abfb27a7b
4 changed files with 147 additions and 1 deletions
29
README.md
29
README.md
|
|
@ -10,7 +10,7 @@ You can use this library to get the text of any user's Tweets trivially.
|
|||
|
||||
## Usage
|
||||
|
||||
### Get tweets
|
||||
### Get user tweets
|
||||
|
||||
```golang
|
||||
package main
|
||||
|
|
@ -32,6 +32,33 @@ func main() {
|
|||
|
||||
It appears you can ask for up to 25 pages of tweets reliably (~486 tweets).
|
||||
|
||||
### Get query search tweets
|
||||
|
||||
Tweets containing “twitter” and “scraper” and “data“, filtering out retweets:
|
||||
|
||||
```golang
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
twitterscraper "github.com/n0madic/twitter-scraper"
|
||||
)
|
||||
|
||||
func main() {
|
||||
for tweet := range twitterscraper.GetSearchTweets("twitter scraper data -filter:retweets", 50) {
|
||||
if tweet.Error != nil {
|
||||
panic(tweet.Error)
|
||||
}
|
||||
fmt.Println(tweet.HTML)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The search ends if we have 50 tweets.
|
||||
|
||||
See <https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/standard-operators> for build standard queries.
|
||||
|
||||
|
||||
### Get profile
|
||||
|
||||
```golang
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue