Kodi Community Forum
[RELEASE] Weather Plus Addon - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Weather Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=155)
+---- Thread: [RELEASE] Weather Plus Addon (/showthread.php?tid=95329)



RE: [RELEASE] Weather Plus Addon - sector72 - 2012-07-07

Looks like NOAA has made some more changes that breaks a few things. Here's is a patch against weatherplus v3.0.1 to get things working again (cumulative with the patch I posted on 6 may 2012...):

Code:
--- noaa.py.orig    2012-07-07 00:17:01.658625504 -0400
+++ noaa.py    2012-07-07 00:16:53.730804446 -0400
@@ -229,7 +229,7 @@
    pattern_current_heatindex = "<td><b>Heat Index</b>:</td>[^<]+<td align=[^>]+>(.+?)\&deg\;F"

    pattern_current_block = "<data type=\"current observations\">"
-    pattern_current_icon = "<icon-link>http://forecast.weather.gov/images/wtf/([^\d\s]+).jpg"
+    pattern_current_icon = "<icon-link>http://forecast.weather.gov/images/wtf/([^\d\s]+).png"
    pattern_current_temp = "<temperature type=\"apparent\"[^>]+>(.+?)</temperature>"
    pattern_current_dew = "<temperature type=\"dew point\"[^>]+>(.+?)</temperature>"
    pattern_current_humidity = "<humidity[^>]+>(.+?)</humidity>"
@@ -239,17 +239,18 @@
    pattern_current_pressure = "<pressure type=\"barometer\"[^>]+>(.+?)</pressure>"
    pattern_current_brief = "<weather-conditions weather-summary=\"([^\"]+)\"/>"

-    pattern_current_wind = "<td><b>Wind Speed</b>:</td>[^<]+<td align=[^>]+>(.+?)</td>"
+    pattern_current_wind   = "<li><span[^>]+>Wind Speed</span>(.+?)</li>"
    pattern_current_wind_2 = "<td><b>Wind Speed</b>:</td><td align=[^>]+>(.+?)<br>"
         pattern_precip_amount = "no-repeat;\">([0-9]+)\%</td><td class=\"weekly_wind\">"
-        pattern_outlook = ": </b>(.+?)<br><br>"
+    pattern_outlook_block = "class=\"point-forecast-7-day\"(.+?)</ul>"
+        pattern_outlook = "</span>(.+?)</li>"
    pattern_sunrise = "sunrise will occur around (.+?)am"
    pattern_sunset = "sunset will occur around (.+?)pm"
    pattern_wind = "<td class=\"weekly_wind\"><img class=\"wind\" src=\"image/(.+?).png\" width=\"50\" height=\"22\" alt=\"[^\"]+\" /><br />(.+?)</td>"
    pattern_xml_high_temp = "<value>(.[0-9]+)</value>"
    pattern_xml_brief = "<weather-conditions weather-summary=\"(.+?)\"/>"    
    pattern_xml_days = "<start-valid-time period-name=\"(.+?)\">"
-    pattern_icon = "<icon-link>(.+?).jpg</icon-link>"
+    pattern_icon = "<icon-link>(.+?).png</icon-link>"

    pattern_alerts = "showsigwx.php[?]([^\"]+)\"><[^>]+>([^<]+)<"

@@ -282,7 +283,7 @@
    current_icon = icondir.get( current_icon, "na" ) + ".png"
    for count in range(0, 13-ampm):
        icon += [ icondir.get ( re.findall( "([^\d\s]+)", icons[count].split("/")[-1] )[0], "na" ) ]
-    # printlog("NOAA icons : " + ",".join(icon))
+    #printlog("NOAA icons : " + ",".join(icon))

         # enumerate thru and combine the day with it's forecast
         if ( len( icon ) ):
@@ -348,7 +349,8 @@
             precip_amount = re.findall( pattern_precip_amount, htmlSource_2 )

             # fetch forecasts
-            outlook = re.findall( pattern_outlook, htmlSource )
+        outlook_block = re.findall( pattern_outlook_block, htmlSource, re.DOTALL )
+            outlook = re.findall( pattern_outlook, outlook_block[0] )

             # fetch extra info
        pressure = re.findall( pattern_current_pressure, current )[0]
@@ -377,10 +379,11 @@
             for count in range(0, 13):
                 # make icon path
                 try :
-                  iconpath = "/".join( [ "special://temp", "weather", "128x128", icon[ count ] + ".png" ] )
+          printlog( "ICON " + str(count) + ": " + icon[count] + ".png" )
+                  iconpath = "/".join( [ "special://temp", "weather", icon[ count ] + ".png" ] )
                 except :
                   printlog("Icon is not available")
-                  iconpath = "/".join( [ "special://temp", "weather", "128x128", "na.png" ] )
+                  iconpath = "/".join( [ "special://temp", "weather", "na.png" ] )
        # printlog( iconpath )
                 # date calculation for 6 day
        year = time.strftime( "%Y", time.localtime() )
@@ -618,36 +621,39 @@
            else:
                outlook = "Rain Likely"
            icon += "rain"
-        elif ( snow[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Snow"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Snow"
-                icon += "chance"
-            else:
-                outlook = "Snow Likely"
-            icon += "snow"
-        elif ( freezing_rain[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Freezing Rain"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Freezing Rain"
-                icon += "chance"
-            else:
-                outlook = "Freezing Rain Likely"
-            icon += "freeze"
-        elif ( sleet[count] != "--" ):
-            if ( rain[count] == "SChc" ):
-                outlook = "Slight Chace of Sleet"
-                icon += "chance"
-            elif ( rain[count] == "Chc" ):
-                outlook = "Chance of Sleet"
-                icon += "chance"
-            else:
-                outlook = "Sleet Likely"            
-            icon += "sleet"        
+        elif ( snow ):
+            if ( snow[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Snow"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Snow"
+                    icon += "chance"
+                else:
+                    outlook = "Snow Likely"
+                icon += "snow"
+        elif ( freezing_rain ):
+            if ( freezing_rain[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Freezing Rain"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Freezing Rain"
+                    icon += "chance"
+                else:
+                    outlook = "Freezing Rain Likely"
+                icon += "freeze"
+        elif ( sleet ):
+            if ( sleet[count] != "--" ):
+                if ( rain[count] == "SChc" ):
+                    outlook = "Slight Chace of Sleet"
+                    icon += "chance"
+                elif ( rain[count] == "Chc" ):
+                    outlook = "Chance of Sleet"
+                    icon += "chance"
+                else:
+                    outlook = "Sleet Likely"            
+                icon += "sleet"        
        elif ( int(wind[count]) > 20 ):
            icon = "windy"
            outlook = "Windy"
@@ -670,4 +676,4 @@
            icon += "cloudy"
            outlook = "Cloudy"
        hour_temp += 1
-        self.forecast += [ ( _localize_unit( hour, "time" ), dates[ count ], "special://temp/weather/128x128/%s.png" % icondir.get(icon, "na"), _localize_unit(temperature[ count ]), outlook, _english_localize_unit( feelslike ), precip[ count ], humidity[ count ], windir.get( wind_direction[ count ] ), _localize_unit( wind[ count ]+" mph", "speed" ), "" ) ]        
+        self.forecast += [ ( _localize_unit( hour, "time" ), dates[ count ], "special://temp/weather/%s.png" % icondir.get(icon, "na"), _localize_unit(temperature[ count ]), outlook, _english_localize_unit( feelslike ), precip[ count ], humidity[ count ], windir.get( wind_direction[ count ] ), _localize_unit( wind[ count ]+" mph", "speed" ), "" ) ]

There's still some weirdness with a missing icon or two that I haven't yet fixed (mostly because I haven't bothered trying to understand how NOAA icons get mapped to XBMC icons) but this patch should be sufficient to stop the script failure messages when using NOAA as the weather source...




RE: [RELEASE] Weather Plus Addon - sector72 - 2012-07-10

Another small patch for the NOAA stuff. This one fixes alert-fetching and the current condition icon. Diff was generated against the patched noaa.py from my July 7 post so you'll need to apply that patch first...

Code:
--- noaa.py.jrm2    2012-07-09 23:05:37.753203712 -0400
+++ noaa.py    2012-07-09 23:57:03.228370708 -0400
@@ -252,7 +252,7 @@
    pattern_xml_days = "<start-valid-time period-name=\"(.+?)\">"
    pattern_icon = "<icon-link>(.+?).png</icon-link>"

-    pattern_alerts = "showsigwx.php[?]([^\"]+)\"><[^>]+>([^<]+)<"
+    pattern_alerts = "showsigwx.php[?]([^\"]+)\">([^<]+)<"

    # fetch alerts
    self.alerts = re.findall( pattern_alerts, htmlSource )
@@ -280,7 +280,7 @@
    # fetch icons
    icon = []
    icons = re.findall( pattern_icon, xmlSource )
-    current_icon = icondir.get( current_icon, "na" ) + ".png"
+    current_icon = icondir.get( current_icon.split("/")[-1], "na" ) + ".png"
    for count in range(0, 13-ampm):
        icon += [ icondir.get ( re.findall( "([^\d\s]+)", icons[count].split("/")[-1] )[0], "na" ) ]
    #printlog("NOAA icons : " + ",".join(icon))




RE: [RELEASE] Weather Plus Addon - vijayk416 - 2012-08-31

Can someone please post an update to the repo that incorporates these patches? Manual patching is not for me and I imagine not for a lot of folks who would like to make use of this fine add-on.


RE: - codex70 - 2012-09-11

(2011-12-27, 04:11)ronie Wrote:
pkscuot Wrote:wunderground isn't available as a source in Weather+ any longer. Apparently when the XBMC folks stuck the deal with Weather Underground to do the weather feed for XBMC Eden it apparently precluded any other plugin provider from using Weather Underground as a data source.

i hope you don't mind if i step in for a sec to correct this piece of information.

wundeground has provided xbmc free access to their api and this is a gesture team xbmc appreciates very much.
you can read all about it here:
http://xbmc.org/theuni/2011/12/10/welcome-sponsor-weather-underground/

the problem we had with weatherplus was the fact that it was scraping the wunderground website.

it's like, someone trusts you with the key to their front-door and we would allow someone else to throw in the window to get inside at the same time.
that just didn't feel right to us.

i have discussed our concern about this with brightsr in PM and we have agreed to work together on a way to give weatherplus access to the wunderground weather data.

it's something (besides a dozen of other things) i'm currently working on.
i have it partially working already locally, so if all goes well, weatherplus users should be able to select wunderground as their service provider again in the near future.

Is there any news on this? I love the extra functionality weather plus gives, but currently it doesn't work at all in the UK. If we could use the wunderground data then that would be perfect.


RE: - ronie - 2012-09-11

(2012-09-11, 10:30)codex70 Wrote:
(2011-12-27, 04:11)ronie Wrote:
pkscuot Wrote:wunderground isn't available as a source in Weather+ any longer. Apparently when the XBMC folks stuck the deal with Weather Underground to do the weather feed for XBMC Eden it apparently precluded any other plugin provider from using Weather Underground as a data source.

i hope you don't mind if i step in for a sec to correct this piece of information.

wundeground has provided xbmc free access to their api and this is a gesture team xbmc appreciates very much.
you can read all about it here:
http://xbmc.org/theuni/2011/12/10/welcome-sponsor-weather-underground/

the problem we had with weatherplus was the fact that it was scraping the wunderground website.

it's like, someone trusts you with the key to their front-door and we would allow someone else to throw in the window to get inside at the same time.
that just didn't feel right to us.

i have discussed our concern about this with brightsr in PM and we have agreed to work together on a way to give weatherplus access to the wunderground weather data.

it's something (besides a dozen of other things) i'm currently working on.
i have it partially working already locally, so if all goes well, weatherplus users should be able to select wunderground as their service provider again in the near future.

Is there any news on this? I love the extra functionality weather plus gives, but currently it doesn't work at all in the UK. If we could use the wunderground data then that would be perfect.

well yes, as promised above, i've added a module to the wunderground addon that can be used by other addons to fetch weather data from the wunderground api.

if anyone wishes to use it, shoot me a PM and i'll help you out



RE: [RELEASE] Weather Plus Addon - codex70 - 2012-09-26

Ronie, did try sending a message, but don't know whether you got it. If you've got any info I may be able to look into fixing this plugin. Would be good to get it working again.


RE: [RELEASE] Weather Plus Addon - ronie - 2012-09-29

(2012-09-26, 17:17)codex70 Wrote: Ronie, did try sending a message, but don't know whether you got it. If you've got any info I may be able to look into fixing this plugin. Would be good to get it working again.

terribly sorry for the late reply...

get the latest development version here:
weather.wunderground-1.0.0.zip

and read the documentation in:
weather.wunderground/resources/lib/wunderground/wunderground.py

if you have any specific question, please ask them here:
http://forum.xbmc.org/showthread.php?tid=116668



RE: [RELEASE] Weather Plus Addon - davidswanson1 - 2012-11-16

Hi, I have a fresh install of XMBC on Windows 7 32 bit Service Pack1 Build 7601
XBMC Version 11.0 GIT:20120321-14FEB09

I enabled Weather Plus in Confusion Skin and also tried Ravier Skin.
All I get is 32Deg. I'm using Weather.com and I tried NOAA and Accuweather. Accuweather wont even find any city when I search.
When I click refresh it fetches no weather.
I've attached my XMBC log.
Any help you be greatly appreciated as I would like to use Weather Plus.
Thank you

EDIT: In-line posting of log removed by moderator. Please upload logs to www.pastebin.com or www.xbmclogs.com


RE: [RELEASE] Weather Plus Addon - artrafael - 2012-11-16

Welcome to the XBMC forums.

Please look at the posts on the previous page of this thread. This add-on is broken and no longer supported. Use the Weather Underground add-on instead.


RE: [RELEASE] Weather Plus Addon - Gingerbread Man - 2013-01-20

..