View previous topic :: View next topic |
Author |
Message |
Mr.Grim Tux's lil' helper
Joined: 28 Nov 2003 Posts: 124
|
Posted: Thu Sep 30, 2004 12:55 am Post subject: gdesklets, weather: Retrieval Failed |
|
|
Hey, I'm trying to get gdesklets weather to work. It says retreivial faild and cant get it to grab my area. here is what i have in the config.
City: Granville
Country: United States
Update Time: 10
Measurement unit: Metric
Time Format: 12 hour
Direct URL: http://weather.yahoo.com/forecast/USOH0360.html
I probably just have the wrong url. Could anyone tell me whats going on? |
|
Back to top |
|
|
koroumel Guru
Joined: 17 Jun 2004 Posts: 339 Location: Athens, Greece
|
Posted: Thu Sep 30, 2004 9:07 am Post subject: |
|
|
Your URL seems to be ok. Can you ping this address? Are you behind a firewall? I guess your network works ok... everybody knows when they don't have internet! _________________ "Yep linux is an alternative. Windows on the other hand isn't even an option"
Registered Linux User No #242616 |
|
Back to top |
|
|
alexod n00b
Joined: 15 Mar 2003 Posts: 69
|
Posted: Sat Oct 02, 2004 9:35 am Post subject: |
|
|
yahoo changed their website layout, so the desklet-sensor can not parse the website correctly
try replace the regexes below
Code: | # regular expressions to parse the weather data |
in __init__.py from the weather desklet with
Code: |
# regular expressions to parse the weather data
RE_TEMPERATURE = re.compile("<b>(?P<temp>\d+)°</b>")
RE_TEMPERATURE_HI = re.compile("")
RE_TEMPERATURE_LO = re.compile("")
RE_TEMPERATURE_FEEL = re.compile("<b>Feels Like:</b></font></td>\n<td><font face=Arial size=2>\n(?P<temp_feel>\d+)")
RE_PRESSURE = re.compile("<b>Barometer:</b></font></td>\n<td><font face=Arial size=2>\n(?P<pressure>[\d\.]+) \w+ \nand (?P<pressure_change>.+)\n")
RE_DEWPOINT = re.compile("<b>Dewpoint:</b></font></td>\n<td><font face=Arial \nsize=2> (?P<dewpoint>\d+)")
RE_WIND = re.compile("<b>Wind:</b></font></td>\n<td><font face=Arial size=2>\n(?P<wind>[\w\s]+)")
RE_HUMIDITY = re.compile("<b>Humidity:</b></font></td>\n<td><font face=Arial size=2>\n(?P<humidity>\d+)\%")
RE_SUNRISE = re.compile("<b>Sunrise:</b></font></td>\n<td><font face=Arial size=2>\n(?P<sunrise>.+)</font></td>")
RE_SUNSET = re.compile("<b>Sunset:</b></font></td>\n<td><font face=Arial size=2>\n(?P<sunset>.+)</font></td>")
RE_VISIBILITY = re.compile("<b>Visibility:</b></font></td>\n<td><font face=Arial size=2>\n(?P<visibility>\S+)")
RE_SKY = re.compile("<br><font face=Arial size=2>(?P<sky>[^\<]+)\</font\>\</td\>")
RE_ICON = re.compile("\<img src=\"http://us.i1.yimg.com/us.yimg.com/"
"i/us/we/52/(?P<icon>\d+).gif\"")
RE_MATCHES = re.compile("Weather location matches:\</font\>\</td\>\n\s*\</tr\>\</table\>\n\s*\<font face=\"arial\" size=-1\>\n\s*\<ul\>\n\s*\<li\>\n\s*\<a href=\"(?P<matchurl>[^\"]+)\"\>")
|
|
|
Back to top |
|
|
|