I am trying to connect to twitter via TwitterVB and the following code does not work(note: removed the consumerKey and consumerKeySecret for privacy issues). When I run the following code it pops up a web page(Attached). What am I doing wrong?
Code:
string consumerKey = “”;
string consumerKeySecret = “”;
TwitterVB2.TwitterAPI tw = new TwitterVB2.TwitterAPI();
if (Request["oauth_token"] == null)
{
Response.Redirect(tw.GetAuthorizationLink(consumerKey, consumerKeySecret));
Debug.WriteLine(tw.OAuth_Token);
Debug.WriteLine(tw.OAuth_TokenSecret);
}
else
{
tw.GetAccessTokens(consumerKey, consumerKeySecret, Request["oauth_token"], Request["oauth_verifier"]);
Debug.WriteLine(tw.OAuth_Token);
Debug.WriteLine(tw.OAuth_TokenSecret);
}
Screenshot: http://picasaweb.google.com/110153104476017462305/Screenshots#5521379134576882050
In short: you need to get
keyandsecretto have access to twitter account. And that could be done only with that form on the screenshot. But that should be done just once. So – give the permission and storekey + secretsomewhere.And here are some useful links for you:
http://dev.twitter.com/pages/auth
http://hueniverse.com/oauth/
http://dev.twitter.com/pages/oauth_faq