Complete classification of weather codes.

yahoo_weather
simon04 14 years ago
parent b417c0a38c
commit 7e4bca3835
  1. 73
      weather@venemo.net/extension.js

@ -116,28 +116,65 @@ WeatherMenuButton.prototype = {
}, },
get_weather_icon: function(code) { get_weather_icon: function(code) {
switch (parseInt(code, 10)){ /* see http://developer.yahoo.com/weather/#codetable */
case 4: switch (parseInt(code, 10)) {
case 0: /* tornado */
case 1: /* tropical storm */
case 2: /* hurricane */
case 3: /* severe thunderstorms */
case 4: /* thunderstorms */
case 17: /* hail */
case 35: /* mixed rain and hail */
case 37: /* isolated thunderstorms */
case 38: /* scattered thunderstorms */
case 39: /* scattered thunderstorms */
case 45: /* thundershowers */
case 47: /* isolated thundershowers */
return 'weather-storm'; return 'weather-storm';
case 5: case 5: /* mixed rain and snow */
case 10: case 7: /* mixed snow and sleet */
case 11: case 13: /* snow flurries */
case 12: case 14: /* light snow showers */
case 39: case 15: /* blowing snow */
case 40: case 16: /* snow */
case 18: /* sleet */
case 41: /* heavy snow */
case 42: /* scattered snow showers */
case 43: /* heavy snow */
case 46: /* snow showers */
return 'weather-snow';
case 6: /* mixed rain and sleet */
case 8: /* freezing drizzle */
case 9: /* drizzle */
case 10: /* freezing rain */
case 11: /* showers */
case 12: /* showers */
case 40: /* scattered showers */
return 'weather-showers'; return 'weather-showers';
case 26: case 26: /* cloudy */
return 'weather-overcast'; case 28: /* mostly cloudy (day) */
case 28: case 30: /* partly cloudy (day) */
case 30: case 44: /* partly cloudy */
case 44: return 'weather-clouds';
return 'weather-few-clouds'; case 27: /* mostly cloudy (night) */
case 32: case 29: /* partly cloudy (night) */
case 34: return 'weather-clouds-night';
case 36: case 31: /* clear (night) */
case 33: /* fair (night) */
return 'weather-clear-night';
case 32: /* sunny */
case 34: /* fair (day) */
case 36: /* hot */
return 'weather-clear'; return 'weather-clear';
case 19: /* dust */
case 20: /* foggy */
case 21: /* haze */
case 22: /* smoky */
case 23: /* blustery */
case 24: /* windy */
case 25: /* cold */
default: default:
return 'weather-snow'; return 'weather-clear';
} }
}, },

Loading…
Cancel
Save