File to go along with request on sf.net page
"""
Requires cron to call "freevo execute 
/usr/lib/python2.4/site-packages/freevo/plugins/weather_helper.py"
to get updates.  The weather.py plugin will grab new data if the cache is older 
than two hours,
so run your cron job more often than that.
"""
import os
import urllib
import config

location = []
dataurl = []
WEATHER_DIR = os.path.join(config.SHARE_DIR, 'images', 'weather')
for local in config.PLUGIN_WEATHER_LOCATIONS:
    location = local[0]
    dataurl = "http://www.msnbc.com/m/chnk/d/weather_d_src.asp?acid=%s"; % 
location
    mapurl = "http://w3.weather.com/weather/map/%s?from=LAPmaps"; % location
    cacheDir = '%s/weather_%s' % (config.FREEVO_CACHEDIR, location)
    cacheFile = '%s/data' % (cacheDir)
    mapFile = '%s/map' % (cacheDir)

    os.system ('wget %s -O %s' % (dataurl, cacheFile ))
    os.system ('wget %s -O %s' % (mapurl, mapFile ))
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to