Update Digsby Status automatically when on Twitter update!
As I mentioned in my previous post, I was working on a solution to sync the twitter update status (one-way), with Digsby’s status. This works great for those that update twitter throughout the day with contact information and such important things. This is a simple console application that makes use of the DigsbyStatus.exe to update the status.
It isn’t a full XML parser and could probably be broken pretty easily by other RSS feeds, so I wouldn’t recommend trying that.
Using the utility is easy, just make sure the DigTweet.exe and DigsbyStatus.exe are in the same folder, and pull up a command prompt.
DigTweet.exe RssLinkSo for example, to sync to my feed, I would enter:
DigTweet.exe http://twitter.com/statuses/user_timeline/14261383.rss
You can find your Twitter RSS feed at the bottom of your personal page (not your homepage, that link will go to a feed of everyone’s status).
If you like, you can make a single-click batch file. Just open notepad and enter the following:
DigTweet.exe http://twitter.com/statuses/user_timeline/14261383.rss
Change the RSS path to your own, and save the file as StartDigTweet.bat. Be careful to not have ‘.txt’ appended to the end by notepad. Click this file and the window will open. You can largely ignore what it’s saying, just minimize it and go on with whatever you’d normally do. Tweets are only updated ONCE, so if it changes the status, and you switch to something else, it won’t be overwritten until a) you restart DigTweet, or b) you have something new in the “top slot” in your feed. (Note: deleting a tweet will cause a sync on the previous tweet)
You can grab a copy of DigTweet today.
Set Digsby Status from Command Line
There was a request today on the Digsby forums about setting the status based on a twitter feed. I thought this was a great idea, since this is something I could use. Normally I don’t use status message at all – but I do twitter.
I set to work figuring out how to set the status from outside the application. I went with the same approach that I had used before, simulating a local user via Win32 Window messages. This is a great solution because it doesn’t interfere with any actions that a user may be performing locally – you don’t even know it is happening.
I broke this project up into the two logical components, the part that gets the twitter feed and the part that actually does the work of setting the status. What I’ve come up with is a little command line utility to set the status.
It can be used like so:
DigsbyStatus.exe "This is my new status message"
Or, to clear the status:
DigsbyStatus.exe ""
Quotes are needed as to simulate a “blank” argument. The status classification can’t be changed, so you will still be available or away based on the protocol and the last state of the computer. I figure someone else might find this useful to, say, update status based on some unsupported media player.
Download: DigsbyStatus_100.zip [10KB]
Tweet from mIRC | mIRC Twitter
Twitter is great, and it’s nice that there is more than one way to send a tweet (message) out, you can use Web, SMS or Google Talk (or even Digsby!). But what if you’re a heavy mIRC user, or if you just like to have more ways to tweet? Clint, on DALnet/#system was working on this, and I’ve added a few things that I think are worth sharing.
How can I use twitter through mIRC?
This would be entered into the Remote script section in mIRC:
alias tweet { ; use /tweet set %tw.username twitter_username_here set %tw.password twitter_password_here ; exit if the message is too long for twitter to take. if ($len($1-) > 140) { echo -a Sorry, that was $calc($len($1-)-140) characters too long! halt } ; connect to twitter on HTTP port 80 set %authentication $encode($+(%tw.username,:,%tw.password),m) sockclose twitter sockopen twitter twitter.com 80 ; set a 2-second timeout in case there is a problem ; this could be changed to 5 or 10 .timertwitter 1 2 twitter_timeout set %tweet $$1- ; store the text } ; encoding is important for sending data to a web server ; the decode function is not used, but is here for the sake of ; completeness alias urlencode return $regsubex($1-,/\G(.)/g,$iif(($prop && \1 !isalnum) || !$prop,$chr(37) $+ $base($asc(\1),10,16),\1)) alias urldecode return $replace($regsubex($1-,/%(\w\w)/g,$chr($iif($base(\t,16,10) != 32,$v1,1))),$chr(1),$chr(32)) ; when the socket accepts our connection on *:sockopen:twitter:{ sockwrite -n twitter POST /statuses/update.json HTTP/1.1 sockwrite -n twitter Host: twitter.com sockwrite -n twitter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5 sockwrite -n twitter Content-Length: $calc($len($urlencode(%tweet)) + 9) sockwrite -n twitter Authorization: Basic %authentication sockwrite -n twitter $crlf sockwrite twitter status= sockwrite -n twitter $urlencode(%tweet) sockwrite twitter $crlf sockwrite twitter $crlf ; send the postdata } ; the data wasn't returned, kill the socket ; and tell the user. alias twitter_timeout { echo -a Message Failed to Send - Socket Timeout sockclose twitter } ; we have data back on *:sockread:twitter: { .timertwitter off sockread -f %string echo -a Message Returned ( $+ %string $+ ) sockclose twitter }
Hopefully this is useful to someone else, I often find myself updating twitter this way, because I always have mIRC open, albeit in the background.
