I'd like to have a link on my website that visitors could click that
would, if they are logged in to their Twitter account simultaneously,
directly add them as followers.
I have attempted to modify a Classic ASP script that did status
updates, for this purpose:
'function asp_twitter_update(strMsg,strUser,strPass)
strUser=YOURUSERNAME
strPass=YOURPASSWORD
from_user=TWITTERACCOUNTTOFOLLOW
dim oXml,strFlickrUrl
strFlickrUrl = "http://twitter.com/friendships/create/" & from_user
&".xml?follow=true"
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 "follow=true"
asp_twitter_update = oXml.responseText
If Err.Number = 0 Then
If oXml.Status = 200 Then
str_GetURL = " You are now following " & from_user
Else
str_GetURL = "Bad URL"
End If
Else
str_GetURL = Err.Description
End If
response.write str_GetURL
response.write asp_twitter_update
Set oXml = nothing
'end function
It gives me the message that I'm following the user, but doesn't
actually work. Any suggestions?
I used the original version to make it so that when someone submits a
classified ad to my site, the site's twitter status updates with an
announcement about the ad. Very nice. It also logs it in a database.