Extend timeline object

This commit is contained in:
Alexander Sheiko 2021-07-16 11:08:43 +03:00
parent 0183c20011
commit 34aae0d008
5 changed files with 311 additions and 306 deletions

View file

@ -46,7 +46,7 @@ func (s *Scraper) FetchTweets(user string, maxTweetsNbr int, cursor string) ([]*
return nil, "", err
}
tweets, nextCursor := parseTimeline(&timeline)
tweets, nextCursor := timeline.parseTweets()
return tweets, nextCursor, nil
}
@ -63,7 +63,7 @@ func (s *Scraper) GetTweet(id string) (*Tweet, error) {
return nil, err
}
tweets, _ := parseTimeline(&timeline)
tweets, _ := timeline.parseTweets()
for _, tweet := range tweets {
if tweet.ID == id {
return tweet, nil