Archive for the ‘Scripts’ tag
Send Twitter Update with VBScript
I was thinking of using Twitter as a kind of ‘syslog’ for all of the scripts we have running (via the task scheduler) all over the enterprise. There is no centralized logging implemented. Ive made some attempts via text files, sql server, the event log, etc., but nothing has taken hold as – easy to implement, universal, and straightforward. This is the visual basic script I came up with to upload the messages.
'**************************************************************************
'* Scriptname: PostToTwitterSimple.vbs
'* TWITTER STATUS UPDATE
'* Brad Shultz - crribs.com
'**************************************************************************
strUsername = "username" 'Username
strPassword = "password" 'Password
strMessage = "This is a test twitter update from a vbscript." 'Message for twitter
strTwitterXMLResponse = SendToTwitter(strMessage, strUsername, strPassword)
'postback what you sent to twitter
MsgBox strTwitterXMLResponse, VbOkOnly, "TWITTER STATUS UPDATE"
Function SendToTwitter(strMessage, strUsername, strPassword)
Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.open "POST", "http://twitter.com/statuses/update.xml", false, strUsername, strPassword
objHTTP.send "status=" & strMessage
SendToTwitter = objHTTP.responseText
Set objHTTP = nothing
End Function