It is currently September 29th, 2024, 7:33 am

Need defintion of weather HTML

General topics related to Rainmeter.
Roger
Posts: 20
Joined: June 22nd, 2015, 2:42 pm

Need defintion of weather HTML

Post by Roger »

I'm trying to debug a skin written by someone else. To get the weather, it parses the HTML from http://yahoowidget.weather.com. I can easily see the HTML using the Debug=2 option, but I'm not sure what some of the HTML means. Is there a list of HTML that this site provides, or HTML definitions somewhere? I assume that there is such a list of definitions but I couldn't find it anywhere. Thanks in advance for any help.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5534
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Need defintion of weather HTML

Post by eclectic-tech »

Basic HTML: http://www.w3schools.com/TAGS/default.asp

Weather coding is unique and needs to be parsed differently on each site.
Looking at the code used in several working weather skins should help you get a better understanding of parsing weather sites.

Feel free to ask for detailed help here on specific problems :welcome:
Roger
Posts: 20
Joined: June 22nd, 2015, 2:42 pm

Re: Need defintion of weather HTML

Post by Roger »

Thanks, eclectic-tech, for your response. I'm asking about specific weather HTML, not the basic HTML described at the w3schools.com site. In the example below, much of the HTML is obvious but I'm uncertain of the meaning of these lines:
<cc> (is this an abbreviation for something?) <flik> (I have no idea what this means), and <icon> (where are the icons that are being referenced? ). There are several other long sections, each of which has several HTML terms that are not obvious to me. I assumed that there would be some comprehensive guide somewhere online. Thanks for any additional help.

<cc>
<lsup>5/10/16 3:25 PM CDT</lsup>
<obst>Washington, IA, US</obst>
<tmp>68</tmp>
<flik>68</flik>
<t>Heavy Rain</t>
<icon>40</icon>

<bar>
<r>29.87</r>
<d>rising</d>
</bar>
<wind>
<s>9</s>
<gust>N/A</gust>
<d>350</d>
<t>N</t>
</wind>
<hmid>94</hmid>
<vis>9.0</vis>
<uv>
<i>3</i>
<t>Moderate</t>
</uv>
<dewp>66</dewp>
<moon>
<icon>4</icon>
<t>Waxing Crescent</t>
</moon>
</cc>
User avatar
jsmorley
Developer
Posts: 22783
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need defintion of weather HTML

Post by jsmorley »

While this is a cheat sheet for the wxdata.weather.com weather feed, I think you will find that the subset Yahoo! Weather gets will use the same <tag> names for elements, since Yahoo! really just uses the Weather.com information. P.S. <cc> just stands for "current conditions", and is just a section header in a sense, not a data element.

Code: Select all

=======================================================================================
Example URL
http://wxdata.weather.com/wxdata/weather/local/USVA0944?cc=*&unit=f&dayf=6&locale=en_US
=======================================================================================

RegExp=#UnitsOfMeasure#
=======================
StringIndex=1	<locale>(.*)</locale>		Locale the feed is using - Example: "en_US"
StringIndex=2	<form>(.*)</form>				Form factor feed is using - Example: "MEDIUM"
StringIndex=3	<ut>(.*)</ut>						Unit of measure for temperature - Example "F"
StringIndex=4	<ud>(.*)</ud>						Unit of measure for distance - Example "mi"
StringIndex=5	<us>(.*)</us>						Unit of measure for speed - Example: "mph"
StringIndex=6	<up>(.*)</up>						Unit of measure for barometric pressure - Example: "in"
StringIndex=7	<ur>(.*)</ur>						Unit of measure for precipitation amount - Example: "in"

RegExp=#Location#
=================
StringIndex=1	<locid="(.*)"						Location ID the feed is using - Example: "USVA0944"
StringIndex=2	<dnam>(.*)</dnam>				Location name the feed is using - Example: "Fort Hunt, VA"
StringIndex=3	<tm>(.*)</tm>						Current time at the location - Example: "11:08 AM"
StringIndex=4	<lat>(.*)</lat>					Latitude of the location - Example: "38.73"
StringIndex=5	<lon>(.*)</lon>					Longitude of the location - Example: "-77.06"
StringIndex=6	<sunr>(.*)</sunr>				Time for sunrise for current day - Example: "6:25 AM"
StringIndex=7	<suns>(.*)</suns>				Time for sunset for current day - Example: "7:50 PM"
StringIndex=8	<zone>(.*)</zone>				Timezone offset from UTC for the location - Example: "-4"

RegExp=#CurrentConditions#
==========================
StringIndex=1	<lsup>(.*)</lsup>				Date and time of the observation - Example: "4/19/16 10:45 AM EDT"
StringIndex=2	<obst>(.*)</obst>				Name of the station making the observation - "Example: "Fort Belvoir, VA, US"
StringIndex=3	<tmp>(.*)</tmp>					Current temperature in degrees - Example: "80"
StringIndex=4	<flik>(.*)</flik>				Current "feels like" temperature in degrees - Example: "79"
StringIndex=5	<t>(.*)</t>							Text of current conditions - Example: "Partly Cloudy"
StringIndex=6	<icon>(.*)</icon>				Icon number for current conditions - Example: "32"

RegExp=#CurrentBarometric#
==========================
StringIndex=1	<r>(.*)</r>							Current pressure reading - Example: "30.06"
StringIndex=2	<d>(.*)</d>							Current direction of pressure "change" - Example: "rising"

RegExp=#CurrentWind#
====================
StringIndex=1	<s>(.*)</s>							Current wind speed - Example: "6" (or "calm")
StringIndex=2	<gust>(.*)</gust>				Current wind gust speed - Example: "10" (or "N/A")
StringIndex=3	<d>(.*)</d>							Current wind direction in compass degrees - Example: "330"
StringIndex=4	<t>(.*)</t>							Current wind direction compass text - Example: "NW"

RegExp=#CurrentElements#
========================
StringIndex=1	<hmid>(.*)</hmid>				Current humidity in percent - Example: "20"
StringIndex=2	<vis>(.*)</vis>					Current visibility distance - Example: "10.0"
StringIndex=3	<i>(.*)</i>							Current UV index number - Example: "5"
StringIndex=4	<t>(.*)</t>							Current UV index text - Example: "Moderate"
StringIndex=5	<dewp>(.*)</dewp>				Current dewpoint in degrees - Example: "36"
StringIndex=6	<icon>(.*)</icon>				Current moon phase icon number - Example: "12"
StringIndex=7	<t>(.*)</t>							Current moon phase text - Example: "Waxing Gibbous"

RegExp=#TodayGeneral#
=====================
StringIndex=1	<lsup>(.*)</lsup>				Date and time of the observation - Example: "4/19/16 10:45 AM EDT"
StringIndex=2	t="(.*)"								Day of the week text - Example: "Tuesday"
StringIndex=3	dt="(.*)"								Month and day text - Example: "Apr 19"
StringIndex=4	<hi>(.*)</hi>						Forecast high temperature in degrees - Example: "81"
StringIndex=5	<low>(.*)</low>					Forecast low temperature in degrees - Example: "45"
StringIndex=6	<sunr>(.*)</sunr>				Time for sunrise for current day - Example: "6:25 AM"
StringIndex=7	<suns>(.*)</suns>				Time for sunset for current day - Example: "7:50 PM"

=====================================================================================================
Note: At some time in the afternoon, all "day" values for "today" will become "", or an empty string.
This is because there can't logically be a "forecast" for a time that has passed.
Test with IFMatch and use "night" values if "day" values are not found.
=====================================================================================================

RegExp=#TodayDayConditions#
===========================
StringIndex=1	<icon>(.*)</icon>				Icon number for today "day" forecast conditions - Example: "32"
StringIndex=2	<t>(.*)</t>							Text of today "day" forecast conditions - Example: "Partly Cloudy"

RegExp=#TodayDayWind#
=====================
StringIndex=1	<s>(.*)</s>							Forecast for today "day" wind speed - Example: "6" (or "calm")
StringIndex=2	<gust>(.*)</gust>				Forecast for today "day" wind gust speed - Example: "10" (or "N/A")
StringIndex=3	<d>(.*)</d>							Forecast for today "day" wind direction in compass degrees - Example: "330"
StringIndex=4	<t>(.*)</t>							Forecast for today "day" wind direction compass text - Example: "NW"

RegExp=#TodayDayElements#
=========================
StringIndex=1	<bt>(.*)</bt>						Short text of today "day" forecast conditions - Example: "P Cloudy"
StringIndex=2	<ppcp>(.*)</ppcp>				Forecast for today "day" precipitation in percent - Example: "10"				
StringIndex=3	<hmid>(.*)</hmid>				Forecast for today "day" humidity in percent - Example: "20"

RegExp=#TodayNightConditions#
=============================
StringIndex=1	<icon>(.*)</icon>				Icon number for today "night" forecast conditions - Example: "32"
StringIndex=2	<t>(.*)</t>							Text of today "night" forecast conditions - Example: "Partly Cloudy"

RegExp=#TodayNightWind#
=======================
StringIndex=1	<s>(.*)</s>							Forecast for today "night" wind speed - Example: "6" (or "calm")
StringIndex=2	<gust>(.*)</gust>				Forecast for today "night" wind gust speed - Example: "10" (or "N/A")
StringIndex=3	<d>(.*)</d>							Forecast for today "night" wind direction in compass degrees - Example: "330"
StringIndex=4	<t>(.*)</t>							Forecast for today "night" wind direction compass text - Example: "NW"

RegExp=#TodayNightElements#
===========================
StringIndex=1	<bt>(.*)</bt>						Short text of today "night" forecast conditions - Example: "P Cloudy"
StringIndex=2	<ppcp>(.*)</ppcp>				Forecast for today "night" precipitation in percent - Example: "10"				
StringIndex=3	<hmid>(.*)</hmid>				Forecast for today "night" humidity in percent - Example: "20"

RegExp=#Day1General#
====================
StringIndex=1	t="(.*)"								Day of the week text - Example: "Wednesday"
StringIndex=2	dt="(.*)"								Month and day text - Example: "Apr 20"
StringIndex=3	<hi>(.*)</hi>						Forecast high temperature in degrees - Example: "81"
StringIndex=4	<low>(.*)</low>					Forecast low temperature in degrees - Example: "45"
StringIndex=5	<sunr>(.*)</sunr>				Time for sunrise for day 1 - Example: "6:25 AM"
StringIndex=6	<suns>(.*)</suns>				Time for sunset for day 1 - Example: "7:50 PM"

RegExp=#Day1DayConditions#
==========================
StringIndex=1	<icon>(.*)</icon>				Icon number for day 1 "day" forecast conditions - Example: "32"
StringIndex=2	<t>(.*)</t>							Text of day 1 "day" forecast conditions - Example: "Partly Cloudy"

RegExp=#Day1DayWind#
====================
StringIndex=1	<s>(.*)</s>							Forecast for day 1 "day" wind speed - Example: "6" (or "calm")
StringIndex=2	<gust>(.*)</gust>				Forecast for day 1 "day" wind gust speed - Example: "10" (or "N/A")
StringIndex=3	<d>(.*)</d>							Forecast for day 1 "day" wind direction in compass degrees - Example: "330"
StringIndex=4	<t>(.*)</t>							Forecast for day 1 "day" wind direction compass text - Example: "NW"

RegExp=#Day1DayElements#
=======================
StringIndex=1	<bt>(.*)</bt>						Short text of day 1 "day" forecast conditions - Example: "P Cloudy"
StringIndex=2	<ppcp>(.*)</ppcp>				Forecast for day 1 "day" precipitation in percent - Example: "10"				
StringIndex=3	<hmid>(.*)</hmid>				Forecast for day 1 "day" humidity in percent - Example: "20"

RegExp=#Day1NightConditions#
============================
StringIndex=1	<icon>(.*)</icon>				Icon number for day 1 "night" forecast conditions - Example: "32"
StringIndex=2	<t>(.*)</t>							Text of day 1 "night" forecast conditions - Example: "Partly Cloudy"

RegExp=#Day1NightWind#
======================
StringIndex=1	<s>(.*)</s>							Forecast for day 1 "night" wind speed - Example: "6" (or "calm")
StringIndex=2	<gust>(.*)</gust>				Forecast for day 1 "night" wind gust speed - Example: "10" (or "N/A")
StringIndex=3	<d>(.*)</d>							Forecast for day 1 "night" wind direction in compass degrees - Example: "330"
StringIndex=4	<t>(.*)</t>							Forecast for day 1 "night" wind direction compass text - Example: "NW"

RegExp=#Day1NightElements#
==========================
StringIndex=1	<bt>(.*)</bt>						Short text of day 1 "night" forecast conditions - Example: "P Cloudy"
StringIndex=2	<ppcp>(.*)</ppcp>				Forecast for day 1 "night" precipitation in percent - Example: "10"				
StringIndex=3	<hmid>(.*)</hmid>				Forecast for day 1 "night" humidity in percent - Example: "20"

==============================================================================================
Days 2 though 5 (possible total of 6 days including "today") follow the same pattern as day 1.
==============================================================================================
The <icon> elements are just numbers. They mean:

Code: Select all

0	tornado
1	tropical storm
2	hurricane
3	severe thunderstorms
4	thunderstorms
5	mixed rain and snow
6	mixed rain and sleet
7	mixed snow and sleet
8	freezing drizzle
9	drizzle
10	freezing rain
11	showers
12	showers
13	snow flurries
14	light snow showers
15	blowing snow
16	snow
17	hail
18	sleet
19	dust
20	foggy
21	haze
22	smoky
23	blustery
24	windy
25	cold
26	cloudy
27	mostly cloudy (night)
28	mostly cloudy (day)
29	partly cloudy (night)
30	partly cloudy (day)
31	clear (night)
32	sunny
33	fair (night)
34	fair (day)
35	mixed rain and hail
36	hot
37	isolated thunderstorms
38	scattered thunderstorms
39	scattered thunderstorms
40	scattered showers
41	heavy snow
42	scattered snow showers
43	heavy snow
44	partly cloudy
45	thundershowers
46	snow showers
47	isolated thundershowers
You will have to have a local set of image files named 0.png ... 47.png that you will use with that code number in an Image meter.

Code: Select all

[MeasureIcon]
Measure=Plugin
Plugin=WebParser
URL=[WeatherParent]
StringIndex=6

[MeterIcon]
Meter=Image
MeasureName=MeasureIcon
ImagePath=#@#Images\TWCIcons
1.jpg
Just my opinion, but I no longer trust the viability of Yahoo! as a weather feed or even as a company, and I would not use them in a skin.
https://forum.rainmeter.net/viewtopic.php?f=15&t=23169
You do not have the required permissions to view the files attached to this post.
Roger
Posts: 20
Joined: June 22nd, 2015, 2:42 pm

Re: Need defintion of weather HTML

Post by Roger »

Thanks JSMorley!!! That's what I was looking for.