Subject: | Bug |
Date: | Wed, 17 Dec 2008 20:08:21 -0000 |
To: | <bug-WWW-Google-Time [...] rt.cpan.org> |
From: | "Neil Stott" <neil.stott [...] blueyonder.co.uk> |
Google appear to also give a table when it has extra suggestions
Two examples are:
"time in norway" # will return table
"time in new york" #will not return table
Below is my method of fixing it:
@data{ qw/time day_of_week time_zone where/ } = $response->content
=~ m/<img \s+ border=0 \s+ width=40 \s+ height=30 \s+ valign=middle
\s+ src=http:\/\/www\.google\.com\/chart\?\S+ \s+
alt="Clock"><\/td><td
\s+ valign=\w{3,6}><b>([^<]+)<\/b> \s+ (\S+) \s+ \( (\w+) \) \s+ -
\s+ <b>Time<\/b>
\s+ in \s+ (.+?)<(br|\/td)>
/x or return $self->_set_error("Could not find time data for that
location");
Regards, Neil
P.S. keep up the good work and once again thanks for help ive had on irc in
the past :-)