Wednesday, June 25, 2008

Recent Hacks: irc2wiki.pl and xchat-nick-pidgin-status.py

The Mono a11y team has weekly iteration meetings in IRC, and we post the logs to the Mono wiki. Our version of MediaWiki doesn't automatically prettify IRC logs, so for awhile I was using Jamie Zawinski's irc2html.pl to create HTML tables. Today I hacked it up to produce MediaWiki tables instead. I call it irc2wiki.pl. Fixes welcome (or better suggestions).

Also, I now live on IRC. Some people prefer to get me through IM, so I always have Pidgin running, but my online presence is mostly reflected in my IRC nick. I'm forgetful, so I kept noticing that I was "available" in Pidgin even though my IRC nick was "sandy|lunch", or that when I changed my nick from "sandy|brb" to "sandy" my Pidgin status would stay the same. I decided to automate that shit. Based on a bunch of useful code from Arstechnica's Ryan Paul, I present to you my first xchat plugin, xchat-nick-pidgin-status.py:


#!/usr/bin/env python

# Sets Pidgin status from XChat nick, assuming you use a style like:
# mynick => Available (status "Workin")
# mynick|busy => Away (status "busy")
# Hobbled together by Sandy Armstrong from code
# written by Ryan Paul (segphault) of Ars Technica:
# http://arstechnica.com/reviews/apps/pidgin-2-0.ars/4
# http://arstechnica.com/journals/linux.ars/2007/08/29/send-twitter-updates-from-xchat-using-python

import xchat, dbus

# Describe the plug-in metadata for XChat
__module_name__ = "Pidgin Status Plug-in"
__module_version__ = "1.0"
__module_description__ = "Set Pidgin status according to XChat nick"

# Specify status ID values
STATUS_AVAILABLE = 2
STATUS_AWAY = 5


def nick(words, word_eol, userdata):
# Get new nick
if len(words) < 2:
return None
new_nick = words[1]

# Check for status
pipe_index = new_nick.find("|")
if pipe_index > 0 and pipe_index < len(new_nick):
message = new_nick[pipe_index + 1:]
# set away with status message
set_status("", STATUS_AWAY, message)
else:
# set available
set_status("", STATUS_AVAILABLE, "Workin")


def set_status(name, kind, message):
# Create a new saved status with the specified name and kind
status = purple.PurpleSavedstatusNew(name, kind)
# Associate the specified availability message with the new saved status
purple.PurpleSavedstatusSetMessage(status, message)
# Activate the new saved status
purple.PurpleSavedstatusActivate(status)


# Initiate a connection to the Session Bus
bus = dbus.SessionBus()

# Associate Pidgin's D-Bus interface with Python objects
obj = bus.get_object(
"im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject")
purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface")


# Associate the nick function with the /nick command in XChat
xchat.hook_command("nick", nick)

Tuesday, June 24, 2008

Tasque 0.1.6 Released

Yesterday I released Tasque 0.1.6 to a legion of hungry Linux users. I can't believe it's been three months since 0.1.5 was released! You can expect to see 0.1.7 a lot quicker, especially because there are some good patches in bugzilla that just need a bit of review.

As you might expect, Tasque 0.1.6 is our best release yet. There's a new task entry widget at the top of the main window, and due dates are parsed right out of the task text. Plus, there are the usual handful of bug fixes, including a few crashers.

Give it a try, and let us know what you think!



Sunday, June 8, 2008

Dear LazyWeb: TiVo, MythTV, Decisions

So we have a TV in the bedroom now. We generally watch TV in the living room, where we have an old Series 2 TiVo that does the job. Now, in the bedroom, we miss the essential TiVo features: accessing recorded shows and pausing/rewinding/fastforwarding live TV.

As far as I can tell, these are my options:
  1. Buy a new TiVo + subscription for the bedroom.
  2. Set up a MythTV box in the bedroom that can get content from the other TiVo using tivodecode.
  3. Buy a MediaMVP or AppleTV and somehow rig it up with tivodecode so I can access content from the other TiVo. This doesn't allow me to pause/rewind/fastforward live TV, though.
Buying a new TiVo has the following costs:
  • New TiVo box: $99
  • New TiVo wireless adapter: $59
  • New TiVo subscription: ~$6/mo
  • Total over one year: $230
Option 2 is setting up a complete MythTV backend+frontend and deploying it in the bedroom. Considering that I'd have to buy a complete PC with a TV tuner, and I'd want it to be attractive and quiet, this would probably be $500-$800. Alternatively I could set up an ugly backend and an attractive frontend, but I doubt that would be any cheaper. This would allow me to have complete TiVo functionality (and more) in the bedroom, and would prevent me from falling further into the TiVo lock-in trap. It's a very tempting solution, but I'm put off by the initial cost.

The Hauppage MediaMVP seems pretty cool. It's hackable, can be made into a MythTV frontend if I ever decide to go down that road, and is super-cheap at $150. The only problem is that I'd either have to use Windows to serve it content, or hack it with MediaMVP Media Center, which doesn't seem very easy to use.

I'm not sure if I can use an AppleTV on my standard def TV. Its only advantage over the MediaMVP is sheer processing power (and easy-to-use interface if I used the provided software). It costs $229.

I guess I have to decide if manipulating live TV in the bedroom is important to me. If not, I could get a MediaMVP or AppleTV and rig up something on the server side to pull content from my TiVo and prep it with tivodecode. This could later be expanded into a full MythTV setup when I feel ready to invest in backend hardware.

However, if pausing/rewinding/fastforwarding live TV is a must, then it seems the more efficient choice is to buy another TiVo.

So, LazyWeb...what should I do? Do you use MythTV? Any compelling reasons that I should invest in setting it up?