login
Blurts on the Art of Software Development

Today | RSS | RDF | Atom | Other Tags
Categories : All | All | CI | .NET | General | Humour | Java | Personal | Reviews | Ruby | SW Eng

The night before leaving for XP Day, I started writing a little bit of Ruby code for translating Frank's blog automatically from German to English so that I could actually read it.

What I managed to accomplish in a couple of hours in the middle of the night was more or less a spike solution that fetched Frank's RSS file from his website, ripped it to pieces, fed the bits and pieces to an online translation service (simulating a web form submission) parsing the translation results from the resulting HTML, and then stuffing these translated snippets back into the feed object hierarchy, eventually printing them out on the console.

Yesterday, feeling unable to make much progress on the book, I decided to pick up the slack and continue developing the feed translator, effectively putting it on Rails. I started by simply glueing what I had behind a Rails controller, fighting off the spider webs I had already managed to grow since I last played with Rails. Eventually, I had a live URL to which I could tack a non-English feed's URL and get back (after a somewhat long wait...) a translated version of the feed, sort of.

Today, I spent a couple of hours cleaning it up, making things a bit more Rubyish, and writing down a little to-do list for the (hopefully near) future. It's far from finished. So far, in fact, that I won't publish the URL since even a bit of traffic could bring down the service altogether... I'll show you a screenshot, though, showing Frank's blog in Bloglines, translated through my feed translator service.

Frank Westphal's blog, translated

As I already mentioned, it's far from ready. There's no caching at all, which is the most pressing issue. I'll have to introduce some kind of a time-expiring cache in front of the translation stuff. Then, I'll go for implementing a conditional get. At some point, I'll probably add gzip compression as well. The translation itself isn't perfect either, but that's something I'll have to live with.

It's actually a bit prettier than the above screenshot would imply (it's old) but there's two rather big limitations that I (so far) can't get over: 1) the quality of the translation service I'm integrating with, and 2) encoding special characters (both for XML and for URL encoding). Better than nothing, though!

I'll keep you posted on the developments...