add user media

This commit is contained in:
Valentine 2024-02-13 04:45:08 +03:00
parent 2de3793bce
commit 4907a49780
3 changed files with 144 additions and 15 deletions

View file

@ -122,6 +122,32 @@ func main() {
It appears you can ask for up to 50 tweets.
### Get user medias
```golang
package main
import (
"context"
"fmt"
twitterscraper "github.com/imperatrona/twitter-scraper"
)
func main() {
scraper := twitterscraper.New()
account, err := scraper.LoginOpenAccount()
if err != nil {
panic(err)
}
for tweet := range scraper.GetMediaTweets(context.Background(), "Twitter", 50) {
if tweet.Error != nil {
panic(tweet.Error)
}
fmt.Println(tweet.Text)
}
}
```
### Get single tweet
```golang