[mythtv-commits] Ticket #7128: mythweather Current Conditions not working with NWS xml script
MythTV
mythtv at cvs.mythtv.org
Tue Sep 22 19:06:17 UTC 2009
#7128: mythweather Current Conditions not working with NWS xml script
----------------------------------------+-----------------------------------
Reporter: Matt W <mwood23 at gmail.com> | Owner: ijr
Type: defect | Status: new
Priority: minor | Milestone: 0.22
Component: Plugin - MythWeather | Version: unknown
Severity: medium | Mlocked: 0
----------------------------------------+-----------------------------------
This report details a few issues with the use of the National Weather
Service XML feed in MythWeather.
Specifically:
1) The script nwsxml.pl in the current SVN is not properly parsing data
returned by the National Weather Service XML feed.
2) The weather-screens.xml file currently contains a reference that causes
the Current Conditions screen to completely ignore NWS as a usable source.
3) The scripts/README file makes reference to the weather-screens.xml but
has a typo/error with regard to the flag passed to the scripts in question
(-T instead of -t)
----
Detailed information:
1) the script nwsxml.pl is not properly parsing data returned, and is
trying to fill array values with data that is not available, resulting in
a concatenation error:
{{{
mythtv2:~/src/mythtv/trunk/mythplugins/mythweather/mythweather/scripts/us_nws$
./nwsxml.pl -u ENG KSFO
cclocation::San Francisco Intl Airport, CA
station_id::KSFO
latitude::37.62
longitude::-122.36
observation_time::Last Updated on Sep 22 2009, 10:56 am PDT
observation_time_rfc822::Tue, 22 Sep 2009 10:56:00 -0700
weather::A Few Clouds
temperature_string::68.0 F (20.0 C)
temp::68.0
relative_humidity::68
wind_string::Northwest at 8.1 MPH (7 KT)
wind_dir::Northwest
wind_degrees::310
wind_speed::8.1
Use of uninitialized value in concatenation (.) or string at ./nwsxml.pl
line 151.
wind_gust::
pressure_string::1016.1 mb
pressure::30.01
dewpoint_string::57.0 F (13.9 C)
dewpoint::57.0
Use of uninitialized value in concatenation (.) or string at ./nwsxml.pl
line 151.
heat_index_string::
Use of uninitialized value in concatenation (.) or string at ./nwsxml.pl
line 151.
heat_index::
Use of uninitialized value in concatenation (.) or string at ./nwsxml.pl
line 151.
windchill_string::
Use of uninitialized value in concatenation (.) or string at ./nwsxml.pl
line 151.
windchill::
visibility::10.00
weather_icon::pcloudy.png
Use of uninitialized value in string eq at ./nwsxml.pl line 131.
Use of uninitialized value in concatenation (.) or string at ./nwsxml.pl
line 151.
appt::
Use of uninitialized value in concatenation (.) or string at ./nwsxml.pl
line 143.
wind_spdgst::8.1 () mph
}}}
In a crude attempt to get this working, I removed the script's references
to these missing fields so that I could at least see it in the Current
Conditions page. Which brings us to #2 ...
2) The weather-screens.xml file contains a reference in the Current
Conditions block that is not provided by the nwsxml.pl script (working or
otherwise). This causes the Current Conditions screen to completely
ignore NWS as a usable source. The reference in question is:
{{{
<datum name="copyright" />
}}}
and this field is not mentioned in the nwsxml.pl script. Once this line
is commented out, the Current Conditions screen will use NWS as a source
once MythWeather's Screen Setup is re-run. I believe there is syntax to
make these fields optional or mandatory but I'm not sure if that code is
fully implemented yet. Which brings us to ...
3) the scripts/README file contains this copy in reference to weather-
screens.xml:
{{{
The text of the name within the weather-ui.xml file (with prepending flag
removed) must match exactly the string returned by the -T flag; as well as
the token returned when retrieving data.
}}}
Actually, '-T' is the flag that shows default timeout values. The flag
'-t' is used to provide the usable strings as provided by a given script.
The README should probably be updated with this minor change.
Here is the version data:
mythbackend:
MythTV Version : 21972
MythTV Branch : trunk
Network Protocol : 48
Library API : 0.22.20090919-1
QT Version : 4.4.3
mythfrontend:
MythTV Version : 21972
MythTV Branch : trunk
Network Protocol : 48
Library API : 0.22.20090919-1
QT Version : 4.4.3
mythweather SVN info:
Revision: 21972
Node Kind: directory
Schedule: normal
Last Changed Author: robertm
Last Changed Rev: 21971
Last Changed Date: 2009-09-21 07:50:06 -0700 (Mon, 21 Sep 2009)
Thank you!
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/7128>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list