It is currently April 19th, 2024, 8:59 am

Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by Mor3bane »

Hello,
I am having difficulty identifying the (?siU) capture for the barometer on this web html capture:
http://wxdata.weather.com/wxdata/weather/local/ASXX0079?cc=*&unit=f&dayf=1

Anyone able to find it?

I have tried looking for the reading to identify e.g. 1010mb or at least the number part.

Any help is appreciated :)
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by FreeRaider »

Try this code

Code: Select all

(?siU).*<bar>.*<r>(.*)</r>
it returns

Code: Select all

01=> 28.61
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by eclectic-tech »

All you want is the current pressure?

It is in Imperial 'Inches' here in the xml you linked to:

Code: Select all

...
<bar>
<r>28.61</r>
<d/>
</bar>
...
And the Webparser measures would be like this:

Code: Select all

[MeasureWebParser]
Measure=Plugin
Plugin=WebParser
URL="http://wxdata.weather.com/wxdata/weather/local/ASXX0079?cc=*&unit=f&dayf=1"
RegExp=(?siU).*<up>(.*)</up>.*<bar>.*<r>(.*)</r>
FinishAction=[!UpdateMeter *]

[MeasureWebParserChild1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWebParser]
StringIndex=1

[MeasureWebParserChild2]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWebParser]
StringIndex=2

[MeterString]
Meter=String
AntiAlias=1
SolidColor=0,0,0,1
MeasureName=MeasureWebParserChild1
MeasureName2=MeasureWebParserChild2
FontColor=128,128,128
FontSize=24
Padding=8,8,8,8
Text=%2 %1
The first child measure is the pressure unit 'type' returned ('in' or 'mb') based on the &unit= in the URL.

The second measure is the actual pressure reading.

Is this what you were asking?

EDIT: The board used to warn when another answer was posted before submitting... guess that isn't working now...
FreeRaider beat me with the basic answer AGAIN! :p
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by Mor3bane »

WOW!

Excellent!

I'll just adjust to the metric mb format

Silly thing is - I had it correct - but the reading was not matching the actual web readout.

As in my widget was returning something in the 990's rather than the just above 1000 on the web site.

Big difference considering on that day a wicked storm boiled up from the leeward side of the mount of Mount Isa - knocked out the power in the whole region for 3 hours. When we say "region" in these here parts it covers a radius of 128 km - with a whole lot of nothing between towns. Just a bit of Aus trivia.

Thanks you guys. I can almost say I am starting to understand the usefulness of the handy (?siU) to parse html :D
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by FreeRaider »

Glad to help.

P.S.: you have two choices: 1) to use "m" in the URL ...&unit=m... or 2) to convert inches of mercury to millibars, multiply the inches value by 33.8637526.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by Mor3bane »

I have an issue with the Weather.com html parsing: The Barometer is reporting wrong - it says 968.85 if that were true it would be an end of days inland deluge of colossal proportions .. it is currently sunny and calm...

So i went to another site that reports my local weather:
https://www.weatherforyou.com/clickcast/international/au/mount+isa+amo.html

How can I access this page for an accurate baro reading?

this is the line with my data:
<span class="Value">1009 mb - Falling Slowly</span>

how would that be captured with (?siU) ?

Thanks for any assistance
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by eclectic-tech »

Parsing a webpage is not reliable, since any change on the page will cause a failure. But try this RegExp in your code.

Code: Select all

RegExp=(?siU).*<div id='currents'>.*<span class='Temp'>(.*)&deg;(.*)</span>.*>(.*)&deg;(.*)<.*Feels Like (.*)&deg;(.*)</span>.*<span .*>(.*)&deg;(.*)</span>.*<span class='Label'>Humidity.*Value'>(.*)</span>.*<span class='Label'>Wind.*Value'>(.*)</span>.*<span class='Label'>Dew Point.*Value'>(.*)&deg;(.*)</span>.*<span class='Label'>Visibility.*Value'>(.*)</span>.*<span class='Label'>Barometer.*Value'>(.*) - (.*)</span>.*Reported from (.*),.*>(.*), at (.*)</td>.*
Using the URL you posted, it returns these StringIndexes:
1 => 29
2 => C
3 => 84
4 => F
5 => 31
6 => C
7 => 88
8 => F
9 => 62%
10 => S 6 KPH
11 => 21
12 => C
13 => 48 km
14 => 1010 mb
15 => Falling Slowly
16 => Mount Isa Airpor
17 => 0.5 kilometers NW of Mount Isa Amo
18 => 10:00 PM Thu, Jan 26, 2017

StringIndex Descriptions:
1~4 current temps (C & F)
5~8 feel like temps (C & F)
9 humidity (percentage)
10 wind (direction and speed)
11 dew point (temp)
12 dew point (degree type)
13 visibility
14 barometer
15 barometer forcast
16 reporting station
17 relation to location
18 time of report
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by Mor3bane »

Thanks eclectic-tech

That helped me get it working.

But how were you able to identify all of the elements? I mean what was your method?

I would like to be able to break things down myself, hopefully - should there be another parsing task I create for myself.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by Mor3bane »

@eclectic-tech

I think I figured it out, in spite of asking just 15 minutes ago.

I went through the code in much the same way I identified the element in the question you answered - found the <body> and expanded the element markers until I could see the ones I found relevant (I'm using Chrome).

As for portability - I tested out with Africa and the barometer still reported correctly - provided the site does not get rearranged in the foreseeable future - using the same base web site that is.

Code: Select all

[MeasureBaro]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=800
UpdateDivider=10
Url=https://www.weatherforyou.com/clickcast/international/au/mount+isa+amo.html
RegExp="(?siU)<span class='Label'>Barometer.*Value'>(.*) - (.*)</span>.*"
Cheers :D
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Another Parsing Request for Help Understanding (?siU) for Barometer Reading

Post by eclectic-tech »

Mor3bane wrote:... But how were you able to identify all of the elements? I mean what was your method?
I use Chrome also. I generally, right-click on the page and select 'View page source'. This opens the code of the page in a new tab that I can search by pressing 'Ctrl+F'.

If I am working with a RegExp, I add 'Debug-2' to the WebParser measure, refresh the skin, and open the 'WebParserDump.txt' file it creates.

The 'WebParserDump.txt' or 'page source' can be copied and pasted into RainRegExp tool by jsmorley.

There are also some good RegExp sites available to test your expression, I like to use RegEx101.

I see you alsready answered your own question, but I hope this additional info helps. :great: