CrazeeIvan / python-weather-api

Automatically exported from code.google.com/p/python-weather-api
MIT License
0 stars 0 forks source link

weather.com doesn't return data for US zip codes #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
pywapi.get_weather_from_weather_com( "US Zip" , imperial )  isn't returning 
data anymore.  I'm just getting an error message.

Traceback (most recent call last):
  File "pywapi-weather-com-example.py", line 7, in <module>
    kalamata = pywapi.get_weather_from_weather_com('USOR0169', 'imperial')
  File "/usr/local/lib/python2.7/dist-packages/pywapi.py", line 212, in get_weather_from_weather_com
    tag)[0].firstChild.data
AttributeError: 'NoneType' object has no attribute 'data'

It still works with the default GRXX0036 location

Original issue reported on code.google.com by jamieada...@gmail.com on 19 Jan 2014 at 8:16

GoogleCodeExporter commented 8 years ago
I was able to replicate the error with the default GRXX0036 location and 
multiple zip codes. The error only occurred in locations where the high 
temperature for the day had already been reached and it was then omitted from 
the XML feed. 

An example section of the XML feed for a working location,

<dayf><lsup>1/21/14 7:00 AM HST</lsup><day d="0" t="Tuesday" dt="Jan 
21"><hi>83</hi><low>69</low><sunr>7:05 AM</sunr><suns>6:10 PM</suns><part 
p="d"><icon>32</icon><t>Sunny</t><wind><s>17</s><gust>N/A</gust><d>230</d><t>SW<
/t></wind><bt>Sunny</bt><ppcp>0</ppcp><hmid>62</hmid></part>

An example section of the XML feed for a location that produces the error,

<dayf><lsup>1/21/14 7:00 AM CST</lsup><day d="0" t="Tuesday" dt="Jan 
21"><hi/><low>-3</low><sunr>7:11 AM</sunr><suns>4:52 PM</suns><part 
p="d"><icon/><t/><wind><s>calm</s><gust>N/A</gust><d>0</d><t>CALM</t></wind><bt/
><ppcp>0</ppcp><hmid>0</hmid></part>

Hope this helps.

Original comment by smith...@gmail.com on 22 Jan 2014 at 1:42

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r153.

Original comment by jtas...@gmail.com on 22 Jan 2014 at 3:14