Recently I toyed with the idea of letting my boss know what tasks I completed in a day in the hope he actually believes I’m doing something. I thought of sending constant emails or keeping a diary. Something briefer was would be more useful.
This got me thinking about services such as Twitter. Perhaps it has a purpose after all.
I do keep track of tasks in Outlook using the “Getting Things Done” method (I’ll post on this another time) using macros. I thought I’d see how easy it was to report status updates to twitter. As it turns out, very easy!
The following simple code sample can be reused to send messages to Twitter:
Sub PromptForTwitterPost() Dim WinHttpReq As New WinHttpRequest
Dim lsInput As String
lsInput = InputBox("Type in text of twitter Post", "Twitter", "")
If lsInput = "" Then Exit Sub
PostToTwitter lsInput
End Sub
Sub PostToTwitter(statusUpdate As String)
PostToTwitterWithAuth statusUpdate, "someuserid", "somepassword"
End Sub
Sub PostToTwitterWithAuth(statusUpdate As String, username As String, password As String)
' Assemble an HTTP Request.
WinHttpReq.Open "POST", _
"http://twitter.com/statuses/update.xml?status=" & statusUpdate, False
WinHttpReq.SetCredentials "yyyyyyyyy", "xxxxxxxxx", HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
' Send the HTTP Request.
WinHttpReq.Send
End Sub
This example will work with any Office VBA or VB6 language.
You can use this macro to use task items to get the status text:
Sub ReportTaskAsComplete()
' Extract task title End Sub
For Each loItem In Outlook.Application.ActiveExplorer.Selection
If TypeOf loItem Is TaskItem Then
Dim loTask As TaskItem
Set loTask = loItem
loTask.Status = olTaskComplete
loTask.Save
PostToTwitter Task.Subject & " - Complete"
End If
Next
Links
- If you want a deluxe solution for Twittering in Outlook, try Outwit
Pingback: Twittering using the Compact Framework « An Original Idea
Question…
In the following what is “yyyyyyyyy” & “xxxxxxxxx” (ie, which one if pass & which userid)?
WinHttpReq.Open “POST”, _
“http://twitter.com/statuses/update.xml?status=” & statusUpdate, False
WinHttpReq.SetCredentials “yyyyyyyyy”, “xxxxxxxxx”, HTTPREQUEST_SETCREDENTIALS_FOR_SERVER
“yyyyyyyyy” is the userid, “xxxxxxxxx” is the password
Thanks for sharing this, I did something similar last year using a userform in Outlook.
Pingback: Updating Twitter via SuperTweet using VBA « An Original Idea