Пример #1
0
func FetchTweet(id int64, api *anaconda.TwitterApi) anaconda.Tweet {
	tweet, err := api.GetTweet(id, nil)
	if err != nil {
		panic(err)
	}
	return tweet
}
Пример #2
0
func hydrateTweet(conf *Config, api *anaconda.TwitterApi, sseEventStream chan<- interface{}, tweetId int64) {
	t, err := api.GetTweet(tweetId, nil)
	if err != nil {
		// log here
		return
	}
	tweet, err := convertTweet(t)
	if err != nil {
		// log here
		return
	}
	conf.StoreTweet(tweet)
	sseEventStream <- tweet
}