Hello all,
I am using the classic ASP OAuth library by Scott DeSapio (http://scottdesapio.com/VBScriptOAuth/) and I’m running in to a code 89/expired token problem. What I’m trying to do is post some text to my twitter account after posting it to my website. To do this, I’m calling on twitter to get the token and token_secret and then trying to use that immediately afterwards to post my status, but it keeps telling me everything is expired. I know I’m getting both token and token_secret returned, but other than that I’m not sure why they would be expired. Can anyone guide me to what I’m doing wrong?
Dim objOAuthReceive : Set objOAuthReceive = New cLibOAuth
objOAuthReceive.ConsumerKey = twitter_consumer_key
objOAuthReceive.ConsumerSecret = twitter_consumer_secret
objOAuthReceive.EndPoint = TWITTER_OAUTH_URL_REQUEST_TOKEN
objOAuthReceive.Host = "api.twitter.com"
objOAuthReceive.RequestMethod = OAUTH_REQUEST_METHOD_GET
objOAuthReceive.TimeoutURL = OAUTH_EXAMPLE_TIMEOUT_URL
objOAuthReceive.UserAgent = "Alert System Updater"
objOAuthReceive.Send()
Dim strRequestToken : strRequestToken = objOAuthReceive.Get_ResponseValue(OAUTH_TOKEN)
Dim strRequestTokenSecret : strRequestTokenSecret = objOAuthReceive.Get_ResponseValue(oauth_token_secret)
Set objOAuthReceive = Nothing
Dim objOAuthSend : Set objOAuthSend = New cLibOAuth
objOAuthSend.ConsumerKey = twitter_consumer_key
objOAuthSend.ConsumerSecret = twitter_consumer_secret
objOAuthSend.EndPoint = "https://api.twitter.com/1.1/statuses/update.json"
objOAuthSend.Host = "api.twitter.com" ' required for twitter apps
objOAuthSend.RequestMethod = "POST"
objOAuthSend.UserAgent = "Alert System Updater" ' required for twitter apps
objOAuthSend.Parameters.Add "oauth_token", strRequestToken
objOAuthSend.Parameters.Add "oauth_token_secret", strRequestTokenSecret
objOAuthSend.Parameters.Add "status", tstatus
objOAuthSend.Send()
Dim strResponseText : strResponseText = objOAuthSend.ResponseText
Dim strErrorCode : strErrorCode = objOAuthSend.ErrorCode
If Not IsNull(strErrorCode) Then
Response.Status = RESPONSE_STATUS_500
Response.Write strErrorCode
Else
Response.ContentType = "text/html"
Response.CharSet = "utf-8"
Response.Write strResponseText
End If
Set objOAuthSend = Nothing