Friday, February 1, 2008

KISS - Keep It Simple Stupid

Perhaps not being a prime example of K.I.S.S, but I made my own Atom parser for the Blogspot feeds in Perl. Having my website under a webhotel, I do not have proper rights to install perl modules directly to Perl module repository, I often find myself fighting over an installation of CPAN module - despite the fact I have a "private" module repository myself. Most of the stuff install there pretty well, after having configured CPAN install properly, but Atom feedreader XML::Atom just did not build OK in my system. It derives a twenty-something subpackages and somewhere along the route, one of them just fails.

So I dug a little what kind of feed the Blogspot Atom feed really is. I found out its pretty simple one, if you just wanna regex through it fast and simple. So here is how it works:

1) Grab the feed with LWP::Simple
2) Run two regexes globally:

$feed =~ m%<published>(\d{4,4}\-\d{2,2}\-\d{2,2}).+?</published><updated>.+?</updated>%g;


$feed =~ m%<title type='text'>(.+?)</title><summary type='text'>(.+?)</summary><link rel='alternate' type='text/html' href='(.+?)' title='.+?'/><link rel='replies' type='text/html' href='.+?postID=([0-9]+)' title='(\d+) Comments'/>%g;

3) ???
4) Profit!!

Not sure if this is any help to anyone, but works great for me! KISSes to everyone!

Tuesday, January 15, 2008

Monkeys do it better

While cleaning up my temporary bookmarks, I found this old link: Chimps Outscore College Students on Memory Test, Memory Test being this game. I scored constantly around 30, and was disappointed I couldn't go higher than 34 in few tries :(

Darwin Awards 2007

The Darwin Awards 2007 has been announced! Knock yourself out by reading the most stupid things humans can attempt.

Sunday, January 13, 2008

New site design

My old site made with PHP3 got a bit broken when my web hotel upgraded its servers to the latest software, including PHP5. It resulted in very broken website where even navigation got busted. I admit that my old code from 2001 was crappy, and the site was due to be recoded for about six years already.

Being left with a broken site was finally the incentive to do something about it. I took an open source design to begin my work with from Open Source Web Designs, designed by Aaron Ganschow, to save time. Hopefully it pays off in the end, currently my new site design is as default as it can be.

I have grand plans about the content on the site. Many of the old stuff that used to be there have disappeared, but new content is slowly finding its way to there. I just have to check and re-check the code, and add the new layout in them. That will take some time, but eventually it pays off.

Check it out here: tanskanen.org.

Wednesday, December 26, 2007

Merry Xmas!

Merry Xmas to everyone and happy holidays!