crribs.com

the blog of brad shultz, systems design, RETS development, ETL, scripting, and windows task scheduler stuff

Archive for the ‘vbs’ tag

Send Twitter Update with VBScript

without comments

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

VBScript IDEs, Debuggers, Editors

without comments

This is an ongoing topic.  Im going to start with the one I use the most.  Pretty much everyday. 

VBSEdit (http://vbsedit.com/)

Pretty much all you need if you do some serious vbscripting.  Right click context menu, run lines or entire scripts and debug them from the editor.  I love the ‘Snippets’ functionality…  why oh why is this not integrated into more text editors (Notepad++, Textpad, ConText, Notepad2, PSPad, Programmers Notepad…come on now….).

Its got an object browser built into it, you can do true debugging (like visual studio – hover your mouse over a variable during runtime to see its current value…). 

And to tie it all together, a single user license (that can be used on multiple machines!!) is only $49.  It always blows my mind when Im looking at code on someone elses computer and they are using notepad.  Its so… masochistic.

vbsedit in action - vbscript ide

vbsedit in action - vbscript ide

Written by admin

August 11th, 2008 at 11:28 pm