Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can implement it using the Twitterizer assembly. Firstly you can create a token which can be used to access Twitter and then using that particular token you can update TwitterStatus (Twitterizer.Core.TwitterObject.TwitterStatus). Sample code is as follows.</p> <pre><code>public void CreateCachedAccessToken(string requestToken) { string ConsumerKey = ConfigurationManager.AppSettings["ConsumerKey"]; string ConsumerSecret = ConfigurationManager.AppSettings["ConsumerSecret"]; OAuthTokenResponse responseToken = OAuthUtility.GetAccessToken(ConsumerKey, ConsumerSecret, requestToken); //Cache the UserId Session["GetCachedUserId"] = responseToken.UserId; OAuthTokens accessToken = new OAuthTokens(); accessToken.AccessToken = responseToken.Token; accessToken.AccessTokenSecret = responseToken.TokenSecret; accessToken.ConsumerKey = ConsumerKey; accessToken.ConsumerSecret = ConsumerSecret; Session["AccessToken"] = accessToken; } </code></pre> <p>To update the TwitterStatus you can do as follows.</p> <pre><code>public OAuthTokens GetCachedAccessToken() { if (Session["AccessToken"] != null) { return (OAuthTokens)(Session["AccessToken"]); } else { return null; } } TwitterStatus.Update(GetCachedAccessToken(), txtTweet.Trim()); </code></pre> <p>The below mentioned method can be used to implement sign in.</p> <pre><code> protected string GetTwitterAuthorizationUrl() { string ConsumerKey = ConfigurationManager.AppSettings["ConsumerKey"]; string ConsumerSecret = ConfigurationManager.AppSettings["ConsumerSecret"]; OAuthTokenResponse reqToken = OAuthUtility.GetRequestToken(ConsumerKey, ConsumerSecret); return "https://twitter.com/oauth/authorize?oauth_token=" + reqToken.Token; } </code></pre> <p>Hope this helps. If there are any clarifications please raise. Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload