本文整理匯總了Golang中github.com/ChimeraCoder/anaconda.TwitterApi.Retweet方法的典型用法代碼示例。如果您正苦於以下問題:Golang TwitterApi.Retweet方法的具體用法?Golang TwitterApi.Retweet怎麽用?Golang TwitterApi.Retweet使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/ChimeraCoder/anaconda.TwitterApi
的用法示例。
在下文中一共展示了TwitterApi.Retweet方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: retweetAndLog
//Retweet the tweet and store the fact that this has been done in Redis
//If the tweet has already been retweeted before, do nothing
func retweetAndLog(api anaconda.TwitterApi, tweet anaconda.Tweet) (err error) {
already_retweeted, err := alreadyRetweeted(tweet)
if err != nil {
return err
}
//Only retweet (and log) if the tweet has not already been retweeted
if !already_retweeted {
if _, err = api.Retweet(tweet.Id, true); err != nil {
return
}
if _, err = c.Do("SET", tweet.Id_str, strconv.FormatInt(time.Now().Unix(), 10)); err != nil {
return
}
log.Printf("Set %s in redis", tweet.Id_str)
return
}
return
}