Reputation: 1380
OAuthTokens tokens = new OAuthTokens();
tokens.AccessToken = "188817262xxxxx";
tokens.AccessTokenSecret = "GNqhB1gkxxxx";
tokens.ConsumerKey = "Q6xxxxx";
tokens.ConsumerSecret = "2eZyxxxxxx";
var<TwitterUser> showUserResponse = TwitterUser.Show(tokens, "twitterUsername");
if (showUserResponse.Result == RequestResult.Success)
{
string screenName = showUserResponse.ResponseObject.ScreenName;
Response.Write(screenName);
Response.Write("<br>");
Response.Write(showUserResponse.ResponseObject.NumberOfFollowers);
}
With this code I can get my Twitter screenName
and numberOfFollowers
, but I want to print those follower screenName
s on my asp.net application. How can I achieve that?
FollowersOptions options = new FollowersOptions();
options.ScreenName = "wallace740";
TwitterResponse<TwitterUserCollection> followers = TwitterFriendship.Followers(options);
// Response.Write(followers.Content);
How can I get the screenName
s of my followers from this JSON (followers.Content
gives me a JSON result)?
Upvotes: 1
Views: 1380
Reputation: 1189
You can enumerate through the ReponseObject.
foreach (var follower in followers.ResponseObject)
{
follower.ScreenName;
}
Upvotes: 1