views:

396

answers:

3

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.

A: 

Simple solution for the php - I think, you can rewrite it on the asp http://www.webmaster-source.com/2009/04/05/post-to-twitter-from-a-php-script/

Here is a example with status, but I think that it simple to upgrade the code.

VMAtm
This script using libraries and they are not part of asp classic libraries.To send the request, we will use cURL, which is included on most servers. First we initiate cURL and pass it the URL we will be sending the request to:$ch = curl_init($twitter_api_url);Can you please not comment if u are wrong?
Younes
+2  A: 

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)
Younes
Note that soon Basic Digest will be removed and this code is no longer applicable. OAuth is the main authentication protocol on Twitter now.
Viet
A: 

please confirm that this still works, because this code stopped working for me around the 20st of Augus 2010. That time Twitter modified it's login procedure.

Amstel08
This won't work anymore since they have changed the way of Authorizing. You now have to use the OAuth method.
Younes