New version of MythTV grabber

Another thing that kept me busy over the last few days was enhancing, tv_grab_nl_upc, my program for fetching television guide data for UPC’s digital cable network in The Netherlands and outputting the results in XMLTV format.

Of all the stuff I’ve written, this is possibly the most obscure and least useful to anyone else (of course, I’ve said that before and been wrong). Nevertheless, necessity is the mother of invention, and I need this program, so I’ve been working on improving it over the Christmas period.

Specifically, this new version uses some heuristics to try to derive a subtitle for the programme in question. Ideally, this should be the episode name for a series, the destination city/country for a travel programme, etc. Sometimes, UPC includes this kind of information as part of the programme’s description, but programmatically determining whether the first sentence of the description is suitable for use as a subtitle is a tricky business; hence the many man hours that have gone into the 0.5.0 release, as I had to perform a fair amount of textual analysis and parser refinement before reaching the point that plucking text from the description to use as the subtitle was logical enough to be more use than hindrance.

Anyway, 0.5.0 of tv_grab_nl_upc is now out, even if I’m the only one who cares.

Posted in Ruby, System Administration | Leave a comment

Christmas specials

I noticed today that our MythTV box was going to fail to record the Christmas special of The Real Hustle. Why? Because the programme’s name was The Real Hustle Christmas and we had instructed the machine to record only The Real Hustle, which as far as MythTV is concerned, is an entirely different programme.

Now, one doesn’t want to have to create a second companion rule for each recording rule, purely to catch the Christmas specials. Nor does one want to have to create a power rule instead of a normal rule, so that one can match the basic programme name followed somewhere by the word Christmas.

What does one really want to do? Ideally, you want to record any programme that has Christmas in the title, if, when the string Christmas or Christmas Special is removed, the remainder of the title matches the name of any programme for which one has already created a recording rule.

To do this, create a custom rule, perhaps called Christmas Specials. In the search phrase, place the following:

program.title LIKE ‘%Christmas%’

AND REPLACE(REPLACE(program.title, ‘ Special’, ”), ‘ Christmas’, ”) =

REPLACE(record.title, ‘ (Power Search)’, ”)

Dissecting this, we first check to see whether a given programme in the TV guide contains the word Christmas in the title. If it does, we remove the suffix Special, if present, from the title. Next, we remove the suffix Christmas from the title. That leaves us with the stub of the programme’s title, which, with a bit of luck, will be the same as the title of a normal episode of the programme.

On the right-hand side of the equality check, we join with the record table to see whether there’s a recording rule with the same name as the title stub of the Christmas programme. The REPLACE function first removes the text that MythTV itself adds to the name of any rule that is a power search, as this will otherwise potentially cause valid matches to be missed.

If we find a match, bingo, the Christmas special is caught in the net and MythTV will record it.

As I’ve said before, absolutely anything is possible with MythTV’s recording scheduler, as long as you can figure out how to express yourself in SQL. This is the first time I’ve found a use for a database table other than program.

Posted in Hacking | Leave a comment

Lazy

We fly to the US in just over a week and our bodies seem to be already preparing for the trip by adjusting to local time on the east coast. The entire family awoke some time after noon today and, even then, I was reluctant to stir.

The weather has been cold and rainy, too, so it’s become a day in front of the fireplace and TV. There’s nothing cosier than relaxing by the fireplace, watching the flames and enjoying what MythTV has managed to catch. Well, having a few friends over to share it with would be even cosier, but we;ll have to wait until Wednesday for that, when Fenella, Tim and their children arrive for a five day visit.

Last Friday saw the delivery of a standard lamp and glass table for the sitting room. At last, we have somewhere to park our Earth From Above.

The sitting room is looking a lot more complete now, although we still have to do something about the desperate lighting situation in there. We’d hoped to remedy that this year, but it will be 2007 now before it happens. Oh well.

Looking back on the last twelve months, we’ve actually achieved quite a lot inside the house. A dining table, eight dining chairs, two couches, two armchairs, two double beds, our new glass coffee table, a side table, an Indian carpet, a standard lamp, and hanging lamps for the entrance and hallway have all been acquired and are contributing to a pleasant living environment.

We’ve also had quite a lot of work done inside the house, from fitting security glass in the doors at the back to installing Ethernet in most of the rooms.

All in all, we’ve come a long way in the last year, and we were gone for two whole months in the summer. 2007 should be the year that the major purchases start to wind down and then it’ll just be a case of making small incremental improvements to give it that personal, lived-in feeling.

Posted in Life | Leave a comment

Weihnachtmarkt

We had a quick break away to Köln (Cologne) at the end of last week. Sarah wanted to see one of the famous German Christmas markets and do some yuletide shopping there. We were there for less than two whole days, but returned with a few goodies to take to the US with us in a couple of weeks. Sarah was satisfied.

From my point of view, it was nice to exchange Amsterdam for Germany for a day or two, absorb the atmosphere of the Weihnachtmarkt, and down some bratwurst, Krakauers, goulash and Glühwein. I thought I was going to return full-bellied, but empty-handed, but at the last minute I actually stumbled upon some wooden coasters I really liked, so we bought eight of them.

Posted in Travel | Leave a comment

New Gadget

It’s been a long time coming, but we biked over to Duikelman in the Ferdinand Bol this afternoon and purchased the only other kitchen appliance I really care about (the first one being a decent coffee machine).

What we splashed out on was a Dualit Vario Combi 2×2 toaster, something of a Rolls Royce amongst toasters.

Dinner consisted of toasties (what else?), with several rounds of delicious, golden toast providing a TV snack later in the evening.

The new Vario has pride of place next to my beloved Z5. Breakfasts will never be the same again.

Posted in House | Leave a comment