Post a message to Twitter using classic asp
I have a small problem. I am busy trying to get messages from a classic asp website to twitter, but I can only find examples of how to do this using php and all other kinds of different languages except for classic asp. Is there anyone here that knows how to get it to work? I have been looking on the net for over 2 hours and found nothing that gets close. Rewriting the php api that i found will take alot of time since it's using libraries which i won't put the time in to convert as this should be a fast 开发者_运维技巧solution.
People,
I have found the solution for classic asp Twitter message posting. Since i have been looking for it quite a long time, I'll post the solution here so other people can make use of it. Actually it's a quite easy solution :). Here we go:
function asp_twitter_update(strMsg,strUser,strPass)
dim oXml,strFlickrUrl
strFlickrUrl = "http://twitter.com/statuses/update.xml"
set oXml = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
oXml.Open "POST", strFlickrUrl, false, strUser, strPass
oXml.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXml.Send "status=" & server.URLencode(strMsg)
asp_twitter_update = oXml.responseText
Set oXml = nothing
end function
And usage of the function like this:
Dim xmlStatuses,strMsg
strMsg = "Hello twitter, send with Classic ASP"
xmlStatuses = asp_twitter_update(strMsg,"yvanruth","xxxlol")
Response.Write(xmlStatuses)
精彩评论