Pages

Monday, August 23, 2010

Twitter with Powerbuilder

Inspired from this article, I trying to made a simple script to post to Twitter from Powerbuilder. All you need is msxml2.dll which located at c:\windows\system32.

And also, you need to create a Twitter's account. Using an OleObject object, try this simple script:

Integer i
OleObject oleTwitter

OleTwitter = CREATE OLEObject
i = oleTwitter.ConnectToNewObject("Msxml2.XMLHTTP")
if i = 0 then
   oleTwitter.Open("POST", "http://youraccount:yourpassword@twitter.com/statuses/update.xml?status=Just for #..., Twitt from Powerbuilder", False)
   oleTwitter.setRequestHeader("Content-Type", "text/xml")
   oleTwitter.Send()
else
   MessageBox("Error","Cannot connect to Object"
end if

Please beware, I don't give a guarantee for any security matters that will caused for your Twitter's account, since I don't have any deep experiences using the XML.

And this is the result:

1 comment: