Wikivoyage parser with heuristics

While travelling through Vietnam, I was using wikivoyage quite intensely as a travel guide and so I started to contribute to some articles there myself. When editing an article, especially cleaning up and structuring long semi-formatted lists of hotels and restaurant was quite annoying, but given the semi-structured shape of the lists, it’s not straight forward, to automate the formatting.

Being annoyed enough by the editing, I took it as a challenge, and wrote a parser making use of a bunch of heuristical rules to classify the list entries, split them into chunks, apply formatting rules on the chunks, and merge it together again into a nicely formatted list entry. So some ugly unstructred listing like

* '''Birmingham Buddhist Centre''', 11 Park Rd, Moseley (''#1, #35 or #50 bus''), ''+44 121'' 449 5279 (''[mailto:info@birminghambuddhistcentre.org.uk info@birminghambuddhistcentre.org.uk]''), [http://www.birminghambuddhistcentre.org.uk/]. A centre run by the Friends of the Western Buddhist Order'' .

* '''Hotel Indah Manila''' 350 A J Villegas St. Tel: ''+63 2'' 5361188, 5362288. [http://www.hotelindah.com/] Rates start at ₱2000 for this modest 76-room hotel. Facilities include Café Indah and conference and function rooms. Airport and city transfers, tour assistance, and laundry service are available.

becomes nicely formatted into

* {{vCard| type=sight| subtype=religious| name=Birmingham Buddhist Centre| address=11 Park Rd, Moseley| directions=#1, #35 or #50 bus| phone=+44 121 449 5279| email=info@birminghambuddhistcentre.org.uk| url=http://www.birminghambuddhistcentre.org.uk/| description=A centre run by the Friends of the Western Buddhist Order.}}

* {{vCard| type=hotel| subtype=hotel| name=Hotel Indah Manila| address=350 A J Villegas St| phone=+63 2 5361188, 5362288| url=http://www.hotelindah.com/| price=Rates start at ₱2000 for this modest 76-room hotel| description=Facilities include Café Indah and conference and function rooms. Airport and city transfers, tour assistance, and laundry service are available.}}

I wrote it as a library and gave it a web frontend using CGI or as a standalone version using bottle. After using python intensely for several years, it’s actually the first time, that I used it to display some web content instead of PHP, and I was a bit surprised, how straight forward it was. So, give it a try, and let me know what you think about it! The source code is available at github.

Iodine fan page

As a frequent traveller you know that shit: You just checked in into a new hotel, paid a totally exaggerated amount of money, and in the end you find out, that not even the wifi was included. Instead they want to charge you an even more exaggerated amount of money. Per minute! As if we would still be living in prehistoric analog times! But wait, no need for hyperventilating and destroying your room like a rockstar: Thanks to the benevolent Flying Spaghetti Monster, there is Iodine!

So I recently decided to show some sign appreciation for this great project, but couldn’t find a fan page on facebook to click the infamous like-button. Long story short, here it is now.

 

Page revival

Computer nerdYes, I admit it. Deep down inside I’m quite a nerd. Programming, hacks, robots, automating things – it’s great! So in order to collect some thoughts and projects, I decided to resurrect this ancient page. Expect to read some stuff about python, programming and net politics here in the future.

The new name for the blog was inspired by this lovely video, which actually encourages us nerds to be nerdy.

Games, games, games

Computer games, yep, I used to play them. Quite a lot even. If I remember correctly, the first game I played was Nibbles, or Snake, as you would call it nowadays probably. This game with the snake eating things and becoming longer all the time, you know it. I was seven, eight maybe? I was playing on an old 286 still with green-only monitor. As a kid, computers were something quite holy and expensive at first, that I weren’t allowed to touch too often.

But the situation became better quickly. We got some shining new 486 with a color monitor. Colors!! And all those lovely jump-n-run games that were suddenly available! Commander Keen, Duke Nukem 1+2 … I guess about this time I started to run into arguments with my parents about how much I was allowed to play the first time. Continue reading Games, games, games