Getting information about the authenticated user
In the Twitter API, the VerifyCredentials
method both lets you verify and get information about the authenticated user. A call to this method can look like:
@using Skybrud.Social.Twitter.Objects.Account
@using Skybrud.Social.Twitter.Options.Account
@using Skybrud.Social.Twitter.Responses.Account
@inherits WebViewPage<Skybrud.Social.Twitter.TwitterService>
@{
// Initials the options
TwitterVerifyCrendetialsOptions options = new TwitterVerifyCrendetialsOptions {
IncludeEmail = true
};
// Make the request to the API
TwitterVerifyCredentialsResponse response = Model.Account.VerifyCredentials(options);
// Get a reference to thr user/account
TwitterAccount account = response.Body;
// Write out some information about the account
<pre>ID: @account.Id</pre>
<pre>Screen name: @account.ScreenName</pre>
<pre>Name: @account.Name</pre>
<pre>Email: @account.Email</pre>
<pre>Followers: @account.FollowersCount</pre>
<pre>Following: @account.FriendsCount</pre>
<pre>Statuses: @account.StatusesCount</pre>
}