本文介绍了TweetSharp让追随者数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有谁知道如何使用TweetSharp得到一些帐户的追随者算不算?
Does anyone know how to use TweetSharp to get some account's follower count?
推荐答案
您可以得到朋友和追随者从TwitterUser对象计数。要直接获取用户:
You can get the friends and followers count from the TwitterUser object. To fetch a user directly:
var twitter = FluentTwitter.CreateRequest()
.Users().ShowProfileFor("jimbob").AsJson();
var response = twitter.Request();
var user = response.AsUser();
Console.Writeline( "jimbob has {0} followers", user.FollowersCount);
用户对象也返回与个别TwitterStatus对象(即微博),这样你就可以从那里得到他们直,避免拨打另一个电话,以及:
User objects are also returned with individual TwitterStatus objects (i.e. tweets), so you can get them straight from there and avoid making another call as well:
var twitter = FluentTwitter.CreateRequest()
.Statuses().OnHomeTimeline().AsJson();
var response = twitter.Request();
var tweets = response.AsTweets();
foreach ( var tweet in tweets )
{
Console.Writeline( "Posted by {0}, who has {1} followers", tweet.User.ScreenName, tweet.User.FollowersCount);
}
这篇关于TweetSharp让追随者数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!