本文整理匯總了Golang中github.com/ChimeraCoder/anaconda.TwitterApi.GetMentionsTimeline方法的典型用法代碼示例。如果您正苦於以下問題:Golang TwitterApi.GetMentionsTimeline方法的具體用法?Golang TwitterApi.GetMentionsTimeline怎麽用?Golang TwitterApi.GetMentionsTimeline使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/ChimeraCoder/anaconda.TwitterApi
的用法示例。
在下文中一共展示了TwitterApi.GetMentionsTimeline方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getMentions
// Get mentions
func getMentions(mentionsCount string, api *anaconda.TwitterApi) []anaconda.Tweet {
params := url.Values{}
params.Set("count", mentionsCount)
// TODO: Track tweet ID we checked up to last time, and check from there onwards
mentions, err := api.GetMentionsTimeline(params)
if err != nil {
log.Fatalf("Failed to get mentions: %s", err)
}
return (mentions)
}
示例2: GetMentions
func GetMentions(api *anaconda.TwitterApi, db *sql.DB) (retrieved_tweets []anaconda.Tweet) {
var lastMention int64
v := url.Values{}
v.Add("count", "200")
v.Add("include_rts", "1")
err := db.QueryRow("SELECT ID FROM tweet ORDER BY ID DESC LIMIT 1;").Scan(&lastMention)
if err == nil {
lastMentionStr := strconv.FormatInt(lastMention, 10)
v.Add("since_id", lastMentionStr)
}
retrieved_tweets, err = api.GetMentionsTimeline(v)
iffy.PanicIf(err)
return
}