How To: Update your Twitter status with ASP

Here is a simple script I wrote in classic ASP to update your Twitter status via the Twitter API. This script handles basic HTTP authentication to validate your Twitter account and URL Encoding to send over friendly status updates.

Response.Buffer = True
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP")

twitter_username = "username" ‘change to your twitter username
twitter_password = "password" ‘change to your twitter password

new_status = "visit strangework.com!" ‘change to your new status

xml.Open "POST", "http://" & twitter_username & ":" & twitter_password & "@twitter.com/statuses/update.xml?status=" & server.URLencode(new_status), False
xml.setRequestHeader "Content-Type", "content=text/html; charset=iso-8859-1"
xml.Send

Response.Write xml.responseText ‘view Twitter’s response

Set xml = Nothing

Popularity: 53% [?]

Tags: , , , ,

Related Blog Posts

1 Comment so far »

  1. Nicolai Rygh said

    am January 5 2008 @ 7:55 am

    Hi Brad!

    Thanks! I’ll include it in my posting tool for my blog!

Comment RSS · TrackBack URI

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: