c# - Error in creating twitterizer app in asp.net -


i using twitterizer dll post twit on twitter via oauth method give me error. "whoa there! there no request token page. that's special key need applications asking use twitter account. please go site or application sent here , try again; mistake."

and code is:

using system; using twitterizer; public partial class home : system.web.ui.page {     protected void page_load(object sender, eventargs e)     {     var oauth_consumer_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";     var oauth_consumer_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";     if (request["oauth_token"] == null)     {         oauthtokenresponse reqtoken = oauthutility.getrequesttoken(oauth_consumer_key, oauth_consumer_secret,             request.url.absoluteuri);         response.redirect(string.format("http://twitter.com/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         };         twitterresponse<twitterstatus> response = twitterstatus.update(accesstoken, "hello everyone, today it's hot (weather)!!!");         if (response.result == requestresult.success)         {             response.write("it's done");         }         else         {             response.write("fail");         }     } } 

}

please me..

seeing no 1 giving answer problem, can suggest library working on.

with tweetinvi able want following code :

// step 1 : redirect user go on twitter.com authenticate public actionresult twitterauth() {     var appcreds = new consumercredentials("consumer_key", "consumer_secret");      // specify url want user redirected     var redirecturl = "http://" + request.url.authority + "/home/validatetwitterauth";     var authenticationcontext = authflow.initauthentication(appcreds, redirecturl);      return new redirectresult(authenticationcontext.authorizationurl); }  // step 2 : on redirected url public actionresult validatetwitterauth() {     // information url     var verifiercode = request.params.get("oauth_verifier");     var authorizationid = request.params.get("authorization_id");      // create user credentials     var usercreds = authflow.createcredentialsfromverifiercode(verifiercode, authorizationid);      // whatever want user now!     viewbag.user = user.getauthenticateduser(usercreds);     return view(); } 

authentication documentation : https://github.com/linvi/tweetinvi/wiki/authentication

i know not helping twitterizer might want consider it.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -