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

Joe Ripley vitaminjoe at gmail.com
Thu Oct 23 02:52:03 UTC 2008


On Fri, Oct 17, 2008 at 11:14 PM, Marc Randolph <mrand at pobox.com> wrote:

> 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)?

All of this 'magic' happens in the WeatherScreen.php class file:
http://svn.mythtv.org/trac/browser/trunk/mythplugins/mythweb/modules/weather/classes/WeatherScreen.php

The PERL scripts are executing in the runScript() function, which in
turn is called by the getData() functon.  getData() copies all of the
PERL script output in to the PHP session variables.

> 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?

As far as I know, the caching is all handled by the PERL scripts
themselves.  The PHP code in MythWeb doesn't do any caching of data,
nor does it read from any cached data... only the PERL scripts
read/write cached data.  Caching is also not a requirement... the
author of the PERL grabber script must implement some type of caching
if he/she feels it necessary.

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

The 18 hour stuff is grabbed by ndfd18.pl, which implements caching
using the Data::Dumper PERL module.  The current conditions stuff is
grabbed by nwsxml.pl which does not implement caching at all.

Enjoy!

-- 
Joe Ripley
vitaminjoe at gmail.com


More information about the mythtv-users mailing list