It is currently March 28th, 2024, 11:17 am

I want to make a super simple skin showing one number from a webpage

Get help with creating, editing & fixing problems with skins
Post Reply
libykim
Posts: 3
Joined: July 14th, 2018, 6:51 am

I want to make a super simple skin showing one number from a webpage

Post by libykim »

I want to make a very basic skin that shows one number that gets updated every hour on a website.

The web address is
https://www.airkorea.or.kr/realSearch24

It shows the air quality index for my area.
(Sorry about the site being in Korean)

On the chart, the first row that is white (right below the gray shaded cells) and the fourth column shows a two digit number, in my case '66' at the moment (may be different depending on area and time). That single cell is what I want to display on my desktop, just in plain white font.

Any help?
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: I want to make a super simple skin showing one number from a webpage

Post by FreeRaider »

Webparser is a basic start.
Have a look a that page in the rainmeter manual.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: I want to make a super simple skin showing one number from a webpage

Post by FreeRaider »

I have investigated that site and unfortunately the table is created by a script, so the information contained in it can not be captured with webparser.
libykim
Posts: 3
Joined: July 14th, 2018, 6:51 am

Re: I want to make a super simple skin showing one number from a webpage

Post by libykim »

FreeRaider wrote:I have investigated that site and unfortunately the table is created by a script, so the information contained in it can not be captured with webparser.
First of all, thanks a lot for taking your time to look into the site for me.

And may I shamelessly ask you if this site
http://aqicn.org/city/seoul/
is possible for webparser?

All I want is that big number on my desktop.
Of course, I want it in a format of my own... (e.g. smaller font, different color, etc..)
But the main thing is having that number on my desktop.

Please! Teach me your way!
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: I want to make a super simple skin showing one number from a webpage

Post by FreeRaider »

libykim wrote:And may I shamelessly ask you if this site
http://aqicn.org/city/seoul/
is possible for webparser?
Yes, it is possible for webparser capture info from that site. In the forum there is an addon RainRegExp - Rainmeter Regular Expression tester used for this "investigation".

Now... for your knowledge, you could try to make a skin ... and if you have problems I (we) would be happy to help you.


Otherwise you can refer to the following skin and modify it as you wish

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Metadata]
Name=Testing
Author=FreeRaider
Information=""
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0


[Variables]
UpdateRateSeconds=600
URL=http://aqicn.org/city/seoul/

[MeasureAQI]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<div class='aqivalue' id='aqiwgtvalue'.*>(.*)</div>
UpdateRate=#UpdateRateSeconds#
StringIndex=1
DynamicVariables=1

[MeterAQI]
Meter=String
MeasureName=MeasureAQI
X=0
Y=0
FontSize=20
FontFace=Courier New
FontColor=255,100,128,255
StringStyle=Bold
StringAlign=Left
AntiAlias=1
DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I want to make a super simple skin showing one number from a webpage

Post by balala »

EDIT: Sorry FreeRaider, you beat me. Again...
libykim wrote:And may I shamelessly ask you if this site
http://aqicn.org/city/seoul/
is possible for webparser?

All I want is that big number on my desktop.
Of course, I want it in a format of my own... (e.g. smaller font, different color, etc..)
But the main thing is having that number on my desktop.
Yes, this is possible and this question had been discussed previously, for example in this thread: https://forum.rainmeter.net/viewtopic.php?f=5&t=28161
Starting from there, the following very simple WebParser measure will acquire and the attached String meter will show up the needed data:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[Variables]
URL=http://aqicn.org/city/seoul/
;URL=http://aqicn.org/city/beijing/

[MeasureAir]
Measure=WebParser
UpdateRate=900
Url=#URL#
RegExp=(?siU)<td id='.*' class='.*' style='.*' align=center>(.*)</td>
StringIndex=1

[MeterAir]
Meter=STRING
MeasureName=MeasureAir
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
When I tested the above code, just to make sure everything is all right, I used the URL for Beijing, too. I commented it out, but leaved there. You can try it out.
Obviously the String meter for example can be easily altered, giving it another color, size or whatever. But first please test this code to see if it works as you want and later we'll do the needed adjustments if you want.
libykim
Posts: 3
Joined: July 14th, 2018, 6:51 am

Re: I want to make a super simple skin showing one number from a webpage

Post by libykim »

Okay, I'm going to try the RainRegExp and see what I can make out of it.

And if I am still lost, I'll look deeper into both of your codes.

Despite FreeRaider's good intention of not spoiling the learning for me, I did glance over both of your codes already.
But no worries, it was a really rough glance to see whether the RegExp was the same or not (which wasn't, and I'll have to figure that out as well), and even if I did look really hard at it I wouldn't understand it as I am a total noob :P

Anyway, I'll come back with what I've learned and managed to create. Thanks!
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I want to make a super simple skin showing one number from a webpage

Post by balala »

libykim wrote:But no worries, it was a really rough glance to see whether the RegExp was the same or not (which wasn't, and I'll have to figure that out as well), and even if I did look really hard at it I wouldn't understand it as I am a total noob :P
Very rarely are in two different codes of two different persons. RainRegExp can be indeed a good start to work with creating the proper RegExp options.
Post Reply