NOTE: This version corrects the @Include .inc files to reflect using the API JSON site.
This uses a series of @Include .inc files to eliminate having to figure out regular expression or even create any measures for your skin. It does all the hard work for you!
Then you can just concentrate on the Meters in your skin. All the measures you will need are already there! Just create the meters, and use the MeasureName= options you can easily get by looking at About/Skins to see what the measure names are that are populated. I tried to make the measure names as descriptive as possible, and if you look in the include files, I have done as much commenting as I can.
If you want to "overload" an included measure, for instance to use Substitute or put an IfCondition or IfMatch on the measure, just create a copy of the measure as a Measure=String or Measure=Calc in the skin, and dynamically use the value of the original measure as a [SectionVariable].
I strongly recommend that you DON'T alter WeatherComJSONMeasures.inc.
That just reduces its usefulness as something you can just plug into another new skin, and makes it very difficult indeed for you if I update it.
WeatherComJSONVariables.inc
This is where you set your Location latitude,longitude, units of measure and Language. Read it for help.
Always @Include this file.
WeatherComJSONMeasures.inc
This parses all 15 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures3Day.inc
This parses 3 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures5Day.inc
This parses 5 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures7Day.inc
This parses 7 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures10Day.inc
This parses 10 days of the JSON code and creates the measures you will need.
Always @Include one and only one of these files.
WeatherComJSONPollenCurrent.inc
This will create measures for the Grass / Tree / Ragweed Pollen levels for the current day
WeatherComJSONPollen29Parts.inc
This will create measures for the Grass / Tree / Ragweed Pollen levels for 29 parts of day and night values
WeatherComJSONPollen15Parts.inc
This will create measures for the Grass / Tree / Ragweed Pollen levels for 15 parts of day and night values
WeatherComJSONPollen7Parts.inc
This will create measures for the Grass / Tree / Ragweed Pollen levels for 7 parts of day and night values
It is optional to @Include one and only one of these files.
WeatherComJSONMoon.inc
This will create measures for the Moon Phase and MoonSet / MoonRise times for 15 days.
WeatherComJSONMoon7Day.inc
This will create measures for the Moon Phase and MoonSet / MoonRise times for 7 days.
It is optional to @Include one and only one of these files.
WeatherComJSONAlerts.inc
This will create measures for any severe weather alerts being returned.
It is optional to @Include this file.
WeatherComJSONLanguage.inc
This will allow you to translate the "labels" I use in my skin to any other language you want.
This is specific to this skin, and you may not need it for yours.
GeneralVariables.inc
This is where I set all the general font and color variables.
This is specific to this skin, and you may not need it for yours.
Once you @Include WeatherComJSONVariables.inc AND WeatherComJSONMeasures.inc in your skin, the following measures will be created. You can use About / Skins to see them AND the values they currently have, but here is a list for reference:
======================
Units of measure
======================
[@UnitsType] : This will be "m" or "e" or "h"
Note that "h" is for the hybrid units used in the UK.
[@UnitsTemperature] : This will be "C" or "F"
[@UnitsSpeed] : This will be "km/h" or "mph"
[@UnitsDistance] : This will be "km" or "mi"
[@UnitsAccumulation] : This will be "cm" or "in"
[@UnitsPrecipitation] : This will be "mm" or "in"
[@UnitsPressure] This will be "mb" or "in"
======================
Location information
======================
[@LocationLatitude] : i.e. 38.805
[@LocationLongitude] : i.e -77.047
[@LocationAdminDistrict]
[@LocationAdminDistrictCode]
These AdminDistrict values will vary in meaning depending on where you live.
In the US, this will be the "state". Other places it may be "region", or just empty.
[@LocationCountry] : i.e. United States of America
[@LocationCountryCode] : i.e. US
[@LocationName] : Location Display Name - Generally the "city"
[@LocationLanguageCode] : i.e. en-US
[@LocationTimeZoneAbbreviation] : i.e. EST
======================
Current weather information
======================
[@CurrentPressure] : Use @UnitsPressure
[@CurrentPressureChangeTrend] : Text "Steady", "Rising", "Falling"
[@CurrentPressureCode] : 0 - "Steady" 1 - "Rising" 2 - "Falling"
[@CurrentPressureChangeAmount] : Use @UnitsPressure
[@CurrentDewPoint]
[@CurrentFeelsLike]
[@CurrentWindGust] : Use @UnitsSpeed
[@CurrentHumidity] : Percentage
[@CurrentIcon]
[@CurrentObservationTimeStamp]
[@CurrentObservationDate]
Automatically uses defined #Lanaguage# (i.e. en-US) to translate Month/Day names.
[@CurrentObservationTime]
[@CurrentConditions] : This is the "long" version
[@CurrentConditionsMedium]
[@CurrentConditionsShort]
[@CurrentCloudCoverPhrase]
[@CurrentPrecipitationLast24Hours] : Use @UnitsPrecipitation
[@CurrentSnowDepth] : Use @UnitsAccumulation
[@CurrentTemperature]
[@CurrentTemperatureMaxSince7AM]
[@CurrentUVIndex] : A range of 1-10
[@CurrentUVDescription]
[@CurrentVisibilityDistance] : Use @UnitsDistance
[@CurrentWindSpeed] : Use @UnitsSpeed
[@CurrentWindDirectionCompass] : i.e. "NNW"
[@CurrentWindDirectionDegrees] : i.e. 220
[@CurrentSunriseTimeStamp]
[@CurrentSunriseTime]
[@CurrentSunSetTimeStamp]
[@CurrentSunsetTime]
======================
Today - Forecast for the entire day
======================
[@ForecastTodayDateString] : Full date string for Today - i.e. "2020-01-21T07:00:00-0400"
[@ForecastTodayDayLong] : Full day of the week i.e. Saturday
[@ForecastTodayDayShort] : i.e. Sat
[@ForecastTodayMonthLong] : i.e. "January"
[@ForecastTodayMonthShort] : i.e. "Jan"
[@ForecastTodayDayOfMonth] : 1-31
[@ForecastTodayNarative]
[@ForecastTodayHighTemperature]
[@ForecastTodayLowTemperature]
[@ForecastTodaySunriseTimeStamp]
[@ForecastTodaySunriseTime]
[@ForecastTodaySunsetTimeStamp]
[@ForecastTodaySunsetTime]
[@ForecastTodayQPFRain] : Quantitative Precipitation Forecasts - Use @UnitsPrecipitation
[@ForecastTodayQPFSnow] : Quantitative Precipitation Forecasts - Use @UnitsAccumulation
======================
Today - Forecast for "Day"
======================
[@ForecastTodayDayPart] : "Today"
[@ForecastTodayDayLetter] : "D"
[@ForecastTodayDayIcon]
[@ForecastTodayDayConditions]
[@ForecastTodayDayConditionsShort]
[@ForecastTodayDayTemperature]
[@ForecastTodayDayHeatIndex]
[@ForecastTodayDayWindChill]
[@ForecastTodayDayNarrative]
[@ForecastTodayDayHumidity]
[@ForecastTodayDayWindSpeed]
[@ForecastTodayDayWindDirectionDegrees] : i.e. 120
[@ForecastTodayDayWindDirectionCompass] : i.e. NNW
[@ForecastTodayDayWindPhrase] : i.e. "Winds SE at 5 to 10 mph."
[@ForecastTodayDayPrecipitationPercent] : Percent likely
[@ForecastTodayDayPrecipitationType] : "rain", "snow" or the generic "precip"
[@ForecastTodayDayPrecipitationAmount]
[@ForecastTodayDayThunderCategory]
[@ForecastTodayDayThunderIndex]
[@ForecastTodayDaySnowAmount] : Use @UnitsAccumulation
[@ForecastTodayDaySnowRange] : Text range, i.e. "2-5" - Use @UnitsAccumulation
[@ForecastTodayDayCloudPercent]
[@ForecastTodayDayUVIndex] : A range of 1-10
[@ForecastTodayDayUVIndexDescription]
Note: At some point in the afternoon, all "TodayDay" measures except
[@ForecastTodayDayLong] will return an empty string. If [@ForecastTodayDayTemperature]
is an empty string, then it is "Tonight". There can't be a "forecast" for a part of day
that has already gone by. You must react to that, and perhaps use "TodayNight"
measures in their place.
======================
Today - Forecast for "Night"
======================
[@ForecastTodayNightPart] : "Tonight"
[@ForecastTodayNightLetter] : "N"
[@ForecastTodayNightIcon]
[@ForecastTodayNightConditions]
[@ForecastTodayNightConditionsShort]
[@ForecastTodayNightTemperature]
[@ForecastTodayNightHeatIndex]
[@ForecastTodayNightWindChill]
[@ForecastTodayNightNarrative]
[@ForecastTodayNightHumidity]
[@ForecastTodayNightWindSpeed]
[@ForecastTodayNightWindDirectionDegrees] : i.e. 120
[@ForecastTodayNightWindDirectionCompass] : i.e. "NNW"
[@ForecastTodayNightWindPhrase] : i.e. "Winds SE at 5 to 10 mph."
[@ForecastTodayNightPrecipitationPercent] : Percent likely
[@ForecastTodayNightPrecipitationType] : "rain", "snow" or the generic "precip"
[@ForecastTodayNightPrecipitationAmount]
[@ForecastTodayNightThunderCategory]
[@ForecastTodayNightThunderIndex]
[@ForecastTodayNightSnowAmount] : Use @UnitsAccumulation
[@ForecastTodayNightSnowRange] : Text range, i.e. "2-5" - Use @UnitsAccumulation
[@ForecastTodayNightCloudPercent]
[@ForecastTodayNightUVIndex] : A range of 1-10
[@ForecastTodayNightUVIndexDescription]
======================
Day2 - Forecast for the entire day
======================
[@ForecastDay2DateString] : Full date string for Tomorrow - i.e. "2020-01-22T07:00:00-0400"
[@ForecastDay2DayLong] : Full day of the week i.e. Sunday
[@ForecastDay2DayShort] : i.e. Sun
[@ForecastDay2MonthLong] : i.e. "January"
[@ForecastDay2MonthShort] : i.e. "Jan"
[@ForecastDay2DayOfMonth] : 1-31
[@ForecastDay2Narative]
[@ForecastDay2HighTemperature]
[@ForecastDay2LowTemperature]
[@ForecastDay2SunriseTimeStamp]
[@ForecastDay2SunriseTime]
[@ForecastDay2SunsetTimeStamp]
[@ForecastDay2SunsetTime]
[@ForecastDay2QPFRain]
[@ForecastDay2QPFSnow]
======================
Day2 - Forecast for "Day"
======================
[@ForecastDay2DayPart] : "Tomorrow"
[@ForecastDay2DayLetter] : "D"
[@ForecastDay2DayIcon]
[@ForecastDay2DayConditions]
[@ForecastDay2DayConditionsShort]
[@ForecastDay2DayTemperature]
[@ForecastDay2DayHeatIndex]
[@ForecastDay2DayWindChill]
[@ForecastDay2DayNarrative]
[@ForecastDay2DayHumidity]
[@ForecastDay2DayWindSpeed]
[@ForecastDay2DayWindDirectionDegrees]
[@ForecastDay2DayWindDirectionCompass]
[@ForecastDay2DayWindPhrase]
[@ForecastDay2DayPrecipitationPercent]
[@ForecastDay2DayPrecipitationType]
[@ForecastDay2DayPrecipitationAmount]
[@ForecastDay2DayThunderCategory]
[@ForecastDay2DayThunderIndex]
[@ForecastDay2DaySnowAmount]
[@ForecastDay2DaySnowRange]
[@ForecastDay2DayCloudPercent]
[@ForecastDay2DayUVIndex]
[@ForecastDay2DayUVIndexDescription]
======================
Day2 - Forecast for "Night"
======================
[@ForecastDay2NightPart] : "Tomorrow night"
[@ForecastDay2NightLetter] : "N"
[@ForecastDay2NightIcon]
[@ForecastDay2NightConditions]
[@ForecastDay2NightConditionsShort]
[@ForecastDay2NightTemperature]
[@ForecastDay2NightHeatIndex]
[@ForecastDay2NightWindChill]
[@ForecastDay2NightNarrative]
[@ForecastDay2NightHumidity]
[@ForecastDay2NightWindSpeed]
[@ForecastDay2NightWindDirectionDegrees]
[@ForecastDay2NightWindDirectionCompass]
[@ForecastDay2NightWindPhrase]
[@ForecastDay2NightPrecipitationPercent]
[@ForecastDay2NightPrecipitationType]
[@ForecastDay2NightPrecipitationAmount]
[@ForecastDay2NightThunderCategory]
[@ForecastDay2NightThunderIndex]
[@ForecastDay2NightSnowAmount]
[@ForecastDay2NightSnowRange]
[@ForecastDay2NightCloudPercent]
[@ForecastDay2NightUVIndex]
[@ForecastDay2NightUVIndexDescription]
This pattern will repeat for Day3 - Day15
Edit: May 15, 2024 - Changed the API Key required.
Edit: January 11, 2022 - Changed the API Key required.
Edit: August 4, 2020 - Added .inc files to provide Pollen level information.
Edit: July 31, 2020 - IMPORTANT! This reworks entirely how the data is retrieved from weather.com, in order to address some ugly changes in the web site. This will now access the API data from weather.com to obtain data, and hopefully will be more stable over time. One critical change is that you no longer can use location "codes" with this, but must use the "latitude,longitude" for the desired location. See WeatherComJSONVariables.inc for details.
Edit: June 20, 2020 - Tweaked the regular expression to account for the fact that there can be commas in several of the fields, like the "narrative" entries. Also added a missing WindPhrase field to the measures.
Edit: June 19, 2020 - Simplified the RegExp for "forecast" somewhat. This is just to make the regular expression a bit simpler and hopefully easier to follow, and doesn't impact any functionality. Also, re-ordered the measures in the "current" section, to make it a bit easier to deal with in About/Skins.
Edit: June 18, 2020 - Revised the WeatherComJSONMoon.inc file, to include the new measure for Moon Phase Days/Age, as well as extending it to support the entire 15 days included in the JSON. I have also created a WeatherComJSONMoon7Day.inc file, which will only parse 7 days, if you don't want or need the full 15.
Edit: June 17, 2020 - Changed how the values for the "day short", "month long", "month short" and "day of month" are retrieved. This will hopefully correct an issue where the "day long" was out of sync with the other values for an hour or so right after midnight.
Edit: June 16, 2020 - Created different versions of WeatherComJSONMeasures.inc based on the number of days you want to forecast.
If you use the full WeatherComJSONMeasures.inc file, that is going to create north of 900 measures in your skin, to support the entire 15 days included in the JSON. I have created versions parsing fewer days, so you don't have to wade through as many measures in About /Skins, many of which you may never use.
WeatherComJSONMeasures.inc
This parses all 15 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures3Day.inc
This parses 3 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures5Day.inc
This parses 5 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures7Day.inc
This parses 7 days of the JSON code and creates the measures you will need.
WeatherComJSONMeasures10Day.inc
This parses 10 days of the JSON code and creates the measures you will need.
Always @Include one and only one of these files.
Edit: June 16, 2020 - Reworked the entire WeatherComJSONMeasures.inc file.
- Added information for all 15 days in the JSON, instead of the previous limit of 7 days.
- Reworked the order of the measures so it makes it easier to follow in About / Skins.
- Integrated daily Sunrise and Sunset into the main .inc file, and eliminated the redundant WeatherComJSONSun.inc file.
- Added some additional fields of information to the measures. See the updated MeasureNamesReference.txt for details.
Just drop the new .inc file(s) in your @Resources folder, and refresh your skin. The new .inc file is fully backwards compatible with your existing skins that use it.
The WeatherComJSONVariables.inc file has not changed in format, so you might want to save yours, to avoid having to reset your Language and LocationCode variables.
Edit: June 11, 2020 - Changed the WebParser super-parent measure to use the new NoCookies and Resync Flag options.
Edit: June 7, 2020 - Corrected the field used for "Current Conditions". A side effect of this is that there are three new measures added:
[@CurrentConditionsMedium]
[@CurrentConditionsShort]
[@CurrentCloudCoverPhrase]
Edit: June 5, 2020 - An entirely new "drop in" version of the @Include .inc files has been created by a collaborative effort of users OnyxBlack, Xenium, and SilverAzide. A TON of thanks to them. Simply replace:
WeatherComJSONMeasures.inc
WeatherComJSONMoon.inc
WeatherComJSONAlerts.inc
In your @Resources folder, refresh your skin, and it should work fine.