Tor

2shortplanks on 2004-10-07T11:32:52

Ooops, I've not been writing in my journal again. I've been busy writing Perl code (or at least, patching Leon's code) honest guv. Oh, and trying to organise things like the London.pm social meeting tonight or the upcoming London Perl Workshop.

Today I found out the rss feed that I wrote for the infobot to work out the current time was broken. Basically, the script goes off to timeanddate.com and looks at the tables on there to work out what time it is the world (since it's easier than working it out yourself - especially when countries keep updating their laws about what time zone they're going to be in and when they're going to daylight saving.) The script as read should have been able to parse the string, but we were getting all these "Tor"s in our output.

Of course, "Tor" is Swedish for "Thu".

Yep. The webserver was looking at the accepted languages and if there was no header it was sending back a sweedish version. So what I was seeing with my browser (that was sending those headers) wasn't the same as what LWP was getting. It never used to do this - to be honest, we English speakers of the world are too lazy, we just assume if we don't specify these kinds of things we're going to get English back.

An additon of:

# all those need to have the english headers now
# or time and date will send us the times in sweedish.  bork bork bork 
WORLD->header("Accept-Language" => "en");
US->header("Accept-Language" => "en");
EUROPE->header("Accept-Language" => "en");
and everything works again.


Norse

jplindstrom on 2004-10-07T11:52:52

I think it's important to know that "Tor" is also the Swedish name of the thunder god "Thor".

Ok, maybe not that important, and you're not that likely to get "I am Thor, god of thunder(tm)" in response to the question "What time is it?". If you do, though, that's the least of your problems.

Re:Norse

Dom2 on 2004-10-07T12:08:28

Well, that's where the name Thursday comes from originally anyway...

And don't miss out on Wodin's day either.

-Dom