From 2fbd561cebc1b6c069878dec7c7e636d0894d735 Mon Sep 17 00:00:00 2001 From: Alexander Sheiko Date: Thu, 13 Aug 2020 17:41:24 +0300 Subject: [PATCH] Quick dirty fix tweets (use search) --- tweets.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tweets.go b/tweets.go index f7cc8fd..15621b3 100644 --- a/tweets.go +++ b/tweets.go @@ -61,7 +61,8 @@ func GetTweets(ctx context.Context, user string, maxTweetsNbr int) <-chan *Resul default: } - tweets, err := FetchTweets(user, lastTweetID) + query := fmt.Sprintf("(from:%s)", user) + tweets, err := FetchSearchTweets(query, lastTweetID) if err != nil { channel <- &Result{Error: err} return @@ -80,7 +81,8 @@ func GetTweets(ctx context.Context, user string, maxTweetsNbr int) <-chan *Resul } if tweetsNbr < maxTweetsNbr { - lastTweetID = tweet.ID + lastId, _ := strconv.ParseInt(tweet.ID, 10, 64) + lastTweetID = strconv.FormatInt(lastId-1, 10) channel <- &Result{Tweet: *tweet} } tweetsNbr++