Hemanth's Scribes

web

OOoTwitter | Open Office Twitter

Author Photo

Hemanth HM

Thumbnail

OOoTwitter | Open Office Twitter

Question : How to twitt from open office?

Download and open this :OOTwitter

Now goto : Tools -> Macros -> Organize macros -> OpenOffice. Org Basic. Edit the OOoTwitter “username:yourpassword” to yours Restart OO and then Tools-> Add-ons -> Post to Twitter Now Twitt from OO :O)

Understanding the code :

 '************************************************************' POST TO TWITTER '************************************************************

Sub PostToTwitter()

‘TxtSnippet=ThisDoc.getCurrentController().getSelection().getByIndex(0).getString()

‘SplitStr = Split(TxtSnippet, ”&”) ‘TwitterStatus = Join(SplitStr, “%20”)

InputMessage=InputBox(“Your message:”, “Post to Twitter”)

SplitStr = Split(InputMessage, ” ”) TwitterStatus = Join(SplitStr, “%20”)

‘Replace the “username:yourpassword” part in the code below with your actual Twitter user name and password. TwMessage=” -u username:yourpassword -d status=” & "" & TwitterStatus & "" & ” http://twitter.com/statuses/update.xml

If GetGUIType=1 Then On Error goto EH Shell(“curl.exe”,1, TwMessage) Else

Shell("curl",1, TwMessage)

End If

MsgBox (“The message has been posted.”, , “All done!”)

Exit Sub EH: MsgBox (“Looks like cURL is not installed.”, , “Error!”)

End Sub

The logic : an InputBox() is used to take the input message, which is then updated to twitter site using the update.xml and based on the status of the execution of the “curl” command the message is posted or not is reported.

#javascript#linux
Author Photo

About Hemanth HM

Hemanth HM is a Sr. Machine Learning Manager at PayPal, Google Developer Expert, TC39 delegate, FOSS advocate, and community leader with a passion for programming, AI, and open-source contributions.