Fetch mentions on startup

This commit is contained in:
Christian Muehlhaeuser 2017-08-29 12:43:18 +02:00
parent cb491fc134
commit 177e6e538c
No known key found for this signature in database
GPG key ID: BA4CF857DD4117E9

View file

@ -14,7 +14,8 @@ import (
)
const (
initialFeedCount = 200
initialFeedCount = 200
initialNotificationsCount = 50
)
// Account is a twitter account for Chirp.
@ -101,6 +102,13 @@ func (mod *Account) Run(eventChan chan interface{}) {
mod.handleStreamEvent(tweets[i])
}
v.Set("count", strconv.FormatInt(initialNotificationsCount, 10))
tweets, err = mod.twitterAPI.GetMentionsTimeline(v)
mod.handleAnacondaError(err, "Could not get mention feed from Twitter API")
for i := len(tweets) - 1; i >= 0; i-- {
mod.handleStreamEvent(tweets[i])
}
mod.handleStream()
}