{"errors":[{"message":"The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.","code":64}]} ------------------------------------------------------------------------------------- ##, <pre lang="C#">private void CheckAuthorization() { try { string oauth_consumer_key = "T3iyMyxKCCrJJMBYLIuAC14rz";//"hhTc2SpEXM8seEpzL14wfzJaV"; string oauth_consumer_secret = "Yqx5dQGvXo9yyVJUAYZhEYmYKoD7o509MB3fRpQAFhRVm4yJKB";//"8clhs2WnVDmgjkeDLkTVS1786HnTjBEM2WKzIjVheGGPJNmgMJ"; if (Request["oauth_token"] == null) { OAuthTokenResponse reqToken = OAuthUtility.GetRequestToken(oauth_consumer_key, oauth_consumer_secret, Request.Url.AbsoluteUri); Response.Redirect(string.Format("https://api.twitter.com/oauth/authorize?oauth_token={0}", reqToken.Token)); //Response.Redirect(string.Format("https://api.twitter.com/1.1/oauth/authorize?oauth_token={0}", reqToken.Token)); } else { string requestToken = Request["oauth_token"].ToString(); string pin = Request["oauth_verifier"].ToString(); var tokens = OAuthUtility.GetAccessToken(oauth_consumer_key, oauth_consumer_secret, requestToken, pin); OAuthTokens accesstoken = new OAuthTokens() { AccessToken = tokens.Token, AccessTokenSecret = tokens.TokenSecret, ConsumerKey = oauth_consumer_key, ConsumerSecret = oauth_consumer_secret }; byte[] photo = File.ReadAllBytes(@"D:\Rajesh\img1.jpg"); TwitterResponse<TwitterStatus> response = TwitterStatus.UpdateWithMedia(accesstoken, "img", photo); if (response.Result == RequestResult.Success) { Response.Write("This is YOUR PAGE"); } else { Response.Write("Try some other time"); } } } catch (Exception ex) { throw ex; } }</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)