add GetTweetReplies method

This commit is contained in:
Valentine 2024-08-01 17:39:06 +03:00
parent e053917d34
commit f86a0ea59d
6 changed files with 232 additions and 7 deletions

29
replies_test.go Normal file
View file

@ -0,0 +1,29 @@
package twitterscraper_test
import (
"testing"
twitterscraper "github.com/imperatrona/twitter-scraper"
)
func TestGetReplies(t *testing.T) {
if skipAuthTest {
t.Skip("Skipping test due to environment variable")
}
tweetId := "1697304622749086011"
tweets, cursors, err := testScraper.GetTweetReplies(tweetId, "")
if err != nil {
t.Fatal(err)
}
if len(tweets) < 2 {
t.Fatal("Less than 2 tweets returned")
}
if len(cursors) < 1 {
t.Fatal("No cursors returned")
}
}