Hi,
what change do i have to make in my asp.net c# application to make it working while upgrading from v1 to v1.1
Right now i am using twitterizer dll to send tweets from my application. It is using twitter api v1.
Please help as i am stuck with it. I am not able to send tweets from my application.
Following is the code i am using
protected void Page_Load(object sender, EventArgs e)
{
var oauth_consumer_key = GlobalVariable.Consumer_Key;
var oauth_consumer_secret = GlobalVariable.Consumer_Secret;
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,
"Its all good here.");
if (response.Result == RequestResult.Success)
{
Response.Write("we did it!");
}
else
{
Response.Write("it's all bad.");
}
}
}