mozor / pipsqueek

A friendly IRC bot
1 stars 3 forks source link

!w works only for US locations #3

Open Lr5 opened 11 years ago

Lr5 commented 11 years ago

The command !w currently seems to work only for US locations. For example, the following commands don't work:

!w Paris, France !w Espoo, Finland !w Espoo

jpearsall commented 11 years ago

This was totally my bad. See lines 47 and 57:

47: my $o_state = $decoded_json->{'location'}->{'state'}; 57: if( $o_tz eq '', $o_city eq '', $o_state eq '' ) {

As we can see with Paris, France and Espoo, Finland there is no state populated:

"country_name":"France", "state":"", "city":"Paris",

"country_name":"Finland", "state":"", "city":"Espoo",

Fix is forthcoming. :)

jpearsall commented 11 years ago

http://pastebin.ca/2313277

Another commit via pastebin :dancer: