December 5, 2005 Archives

also!

posted by tom / December 05, 2005 / leave a comment /

On Friday Charles, Aaron and I headed out to Vienna to see Julie off to Denver. It was fun. How fun? This fun.

Needless to say, we're all sorry to see Julie go. She's sweet, and funny, and pretty well guaranteed to brighten the day of everyone she runs into. But the duties of aunthood call! So good luck in the mile-high city, Julie. We all expect much better home run production next season.

wintry mix

posted by tom / December 05, 2005 / leave a comment /

It sounds like the winter storm currently bearing down on Washington (shotgun full of snow, etc.) isn't going to come through. Topper Shutt's Bread-O-Meter stands at a meager 4.5, and is likely to dip even lower. Normally I wouldn't put a lot of stock in a local weatherguy's opinion. But Topper has always been Catherine's and my favorite: he has the saddest eyes of any weatherman. The rough and tumble world of meteorological prognostication was never meant for a soul as gentle as he.

But maybe it's for the best that the storm is dissipating, seeing as our furnace has been broken since Friday morning. For a while it was just freezing cold every morning. I was prepared to chalk this up to my inability to comprehend our stupefyingly complex digital thermostat, but our landlord had an HVAC guy come by on Friday to have a look anyway. I don't know what he did, but I know it was a bad idea. Prior to his visit the furnace had been deeply troubled but high-functioning. Afterward — well, on the plus side there was now a red LED illuminated on the thermostat. On the minus side, the system no longer produced actual heat. Hmm.

Saturday morning brought a 52 degree wakeup — time to call the landlord, who came right over, accepted our mutual impotence in the face of a broken heat pump, and then went to buy us some space heaters. Charles and I can now be luxuriously toasty in up to one room at a time, provided we don't mind tripping the circuit breaker every time so much as the refrigerator light goes on.

Being cold sucks, but it's at least conceptually pleasing to my cheapskate nerd side. Every power adapter, light bulb, computer and appliance around me, although cherished, is horribly inefficient. Entropy's inevitability doesn't just mean that you and I will die and that our universe will someday collapse into a cold, empty cloud of lifeless elementary particles (although its more practical upshot is just that I'm usually too existentially distraught to bother picking up my room). It also means that nearly everything in your house that takes electricity turns more than half of the energy it consumes into heat rather than useful work.

But with the furnace broken, suddenly all of that waste heat is an asset. I'm glad of every wasted watt-second, every gently warm plug pack. Up yours, physics! I'm getting my money's worth at last, Pepco! It's true that the heat-pump's 100+% efficiency has a distinct perpetual-motion-machine allure, but for now I'm happy shooting heat out of every available appliance and into my frozen toes. Time to start Linux recompiling again for no particular reason.

three cheers for the nanny state

posted by tom / December 05, 2005 / leave a comment /

Telecom customers get better services and prices when the industry is more heavily regulated. Via Slashdot.

screenscraping movable type

posted by tom / December 05, 2005 / 5 comments /

Have I rhapsodized about Perl yet? Well, I'm going to. The language has been around for ages, but I've always been put off by its godawful syntax. And I still am. But it's just so damn powerful. The stuff you can do with the LWP module alone is staggering -- and that's just one of tens of thousands of modules that can extend the language's capabilities.

The syntax may be horrifying, but once you know how to do something it's simple to do it again. For example, retrieving a web page within even a friendly environment like .NET can be a relatively large pain in the ass. Generally speaking, you've got to initialize an object, use it to make the request, and set up an asynchronous callback to handle the response. With the LWP package you just write $variable = get($url);. That's hot.

For anyone who already uses Perl on a regular basis, my revelation is no doubt extremely banal. But for any vaguely techy types who might delay learning it, like I did: don't. It's way too useful.

With that said, my recent evangelism is motivated by the success I had over the weekend writing a set of scripts to scrape a Movable Type site (that shall remain nameless) off of the web and into a format that can imported into a different MT installation. My scripts are probably too site-specific to be worth releasing (email me if you want em anyway), but here are some general tips for googlers looking to solve the same problem:

  1. Pull down the category archive pages.
  2. Scrape 'em to get out the individual entries' permalinks.
  3. Pull down each individual entry by its permalink.
  4. Strip out the header and footer, but leave the RDF block (it's your friend).
  5. Process the remaining entries for image tags, pulling the files down and rewriting the links to match your new site's URL.
  6. Extract the data necessary to match MT's import format and spit it out into an appropriate text file.

This will all go without saying for anyone who knows what they're doing. For those that don't — hey, it's a starting point. Go read up on your regexes and get cracking.

Google Analytics