[mythtv-users] Trying to fix a bug.... How do the mythweather scripts communicate?

Marc Randolph mrand at pobox.com
Sat Oct 18 05:14:04 UTC 2008


Howdy all,

I'll try to keep this as short as I can... private replies are welcome
if you don't think it would be of much interest to others.  There is a
small bug in the weather component of mythweb that I'd like to try to
fix (as much a learning experience for me as fixing a bug), but I'm
missing part of the puzzle and haven't been able to figure it out on
my own, even after looking over a bunch of the code and the README in
the source.

I see, and partially understand the perl scripts (like nwsxml.pl and
ndfd18.pl) which get called to retrieve the weather data from the
outside world, and I see and partially understand the php files (like
weather.cc.php and weather.18h.php) that format and serve up the data
for the web browser.  The part I'm missing is the details on how the
two are connected.  What are all the methods that php obtains the
weather data that the perl scripts retrieved and how do they work?

More specifically:
1. for example, in nwsxml.pl, there appears to be some magical way
(via $key and $xml->{$key}) that data appears over in php land when it
does $screen->data["<key name>"].  Is this via an XML file somewhere
(if so, where is the code that opens it)?

2. Other pairs, such as the weather.18hr.php and ndfd18.pl, appear to
use an additional external cache file.  It looks like the line "print
CACHE Dumper($result);" must be what writes the data out to that
cache, but then I can't figure out how weather.18h.php makes use of
that cache?  Does it not need to open the cache file before accessing
it?

3. Why did the 18 hour stuff use the cache, but the current conditions
does not?  Surely the URL's are too long!

A bit of background for whomever is kind enough to help me give back
to Myth: I've written a fair share of C code in the past (some
professionally, 15-20 years ago), but have been out of the software
programming world since then and never jumped on the OO bandwagon.

Thanks a million!

   Marc


More information about the mythtv-users mailing list