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
Sub PostToTwitter(statusUpdate As String)
PostToTwitterWithAuth statusUpdate, "someuserid", "somepassword"
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.
Dim WinHttpReq As New WinHttpRequest
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:
' 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
PostToTwitter Task.Subject & " - Complete"
' Extract task title
- If you want a deluxe solution for Twittering in Outlook, try Outwit