Submitting to Twitter with Classic ASP

Discussion in 'ASP Forum' started by pletcherfjo, Apr 9, 2013.

  1. pletcherfjo

    pletcherfjo New Member

    I am trying to implement twitter posting on a website. when a user posts an alert and they check off "submit to twitter" I want to send the contents of the box (140 chars of it) to the associated twitter account. So I've done the following:
    • Registered a new app in twitter
    • Gotten all of my tokens/keys
    • Set up the following library: http://scottdesapio.com
    • Changed all of the parameters per the instructions
    Every time I try to submit, though, I'm getting an "Could not authenticate with OAuth" error. I'm trying to do this all in one go, so I'm not grabbing the token from twitter but filling in both the oauth_token and the oauth_token_secret in my request, but still nothing. Has anyone had success with doing something like this in classic ASP?Code:\[code\]Dim objOAuth : Set objOAuth = New cLibOAuthobjOAuth.ConsumerKey = twitter_consumer_keyobjOAuth.ConsumerSecret = twitter_consumer_secretobjOAuth.EndPoint = "http://twitter.com/statuses/update.json"objOAuth.Host = "api.twitter.com"objOAuth.RequestMethod = "POST"objOAuth.UserAgent = "Alert System Updater" objOAuth.Parameters.Add "oauth_token", twitter_oauth_tokenobjOAuth.Parameters.Add "oauth_token_secret", twitter_oauth_secretobjOAuth.Parameters.Add "status", tstatusobjOAuth.Send()Dim strResponseText : strResponseText = objOAuth.ResponseTextDim strErrorCode : strErrorCode = objOAuth.ErrorCodeIf Not IsNull(strErrorCode) Then Response.Status = RESPONSE_STATUS_500 Response.Write strErrorCodeElse Response.ContentType = "text/html" Response.CharSet = "utf-8" Response.Write strResponseTextEnd If\[/code\]
     

Share This Page