Parse a retweet like a full tweet

This commit is contained in:
Alexander Sheiko 2021-07-16 11:37:43 +03:00
parent 34aae0d008
commit c370a9078f
3 changed files with 14 additions and 19 deletions

View file

@ -96,12 +96,18 @@ func TestGetTweet(t *testing.T) {
}
func TestRetweet(t *testing.T) {
sample := Retweet{
ID: "1359151057872580612",
TimeParsed: time.Date(2021, 02, 9, 14, 43, 58, 0, time.FixedZone("UTC", 0)),
Timestamp: 1612881838,
UserID: "773578328498372608",
Username: "TwitterTogether",
sample := &Tweet{
HTML: "Weve seen an increase in attacks against Asian communities and individuals around the world. Its important to know that this isnt new; throughout history, Asians have experienced violence and exclusion. However, their diverse lived experiences have largely been overlooked.",
ID: "1359151057872580612",
Likes: 6683,
PermanentURL: "https://twitter.com/TwitterTogether/status/1359151057872580612",
Replies: 455,
Retweets: 1495,
Text: "Weve seen an increase in attacks against Asian communities and individuals around the world. Its important to know that this isnt new; throughout history, Asians have experienced violence and exclusion. However, their diverse lived experiences have largely been overlooked.",
TimeParsed: time.Date(2021, 02, 9, 14, 43, 58, 0, time.FixedZone("UTC", 0)),
Timestamp: 1612881838,
UserID: "773578328498372608",
Username: "TwitterTogether",
}
tweet, err := defaultScraper.GetTweet("1362849141248974853")
if err != nil {