本文整理汇总了Golang中github.com/ChimeraCoder/anaconda.TwitterApi.GetUsersShow方法的典型用法代码示例。如果您正苦于以下问题:Golang TwitterApi.GetUsersShow方法的具体用法?Golang TwitterApi.GetUsersShow怎么用?Golang TwitterApi.GetUsersShow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/ChimeraCoder/anaconda.TwitterApi
的用法示例。
在下文中一共展示了TwitterApi.GetUsersShow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GetTimelines
func GetTimelines(api *anaconda.TwitterApi, account string, since int64) timelinesTweets {
myTweets := make(timelinesTweets)
var max_id int64
var tweet anaconda.Tweet
searchresult, _ := api.GetUsersShow(account, nil)
v := url.Values{}
var timeline []anaconda.Tweet
var Tweettime string
v.Set("user_id", searchresult.IdStr)
v.Set("count", "1") //getting twitter first tweet
timeline, _ = api.GetUserTimeline(v)
max_id = timeline[0].Id // putting it as max_id
time, _ := timeline[0].CreatedAtTime()
for time.Unix() >= since { //until we don't exceed our range of interest
v = url.Values{}
v.Set("user_id", searchresult.IdStr)
v.Set("count", "200")
v.Set("max_id", strconv.FormatInt(max_id, 10))
timeline, _ = api.GetUserTimeline(v)
for _, tweet = range timeline {
time, _ = tweet.CreatedAtTime()
myTweets[tweet.IdStr] = tweet
Tweettime = fmt.Sprintf("%d-%02d-%02dT%02d:%02d:%02d", time.Year(), time.Month(), time.Day(), time.Hour(), time.Minute(), time.Second())
log.Info("\tTweet @ " + Tweettime + " : " + tweet.IdStr)
max_id = tweet.Id
}
log.Info("\tFinished reading timeslice for " + account)
}
log.Info("\tFinished reading timeline for " + account)
return myTweets
}
示例2: GetFollowingNumber
func GetFollowingNumber(api *anaconda.TwitterApi, account string) int {
searchresult, _ := api.GetUsersShow(account, nil)
return searchresult.FriendsCount
}