It is currently March 28th, 2024, 8:53 am

Downloading and updating satelite images

General topics related to Rainmeter.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Downloading and updating satelite images

Post by Matth »

Hi

On http://www.data.jma.go.jp/mscweb/data/himawari/sat_img.php?area=fd_ you can download satelite images (Check the True Color Reproduction Image).

I guess it is possible to parse the page with the files (http://www.data.jma.go.jp/mscweb/data/himawari/list_fd_.html) every 10 minutes and download all the files and display them.

Since each file only gets updated once per day, I was wondering if it is possible to somehow just download the "latest" file and store it locally, until it gets overwritten again in 24 hours.

And since I'm an absolute beginner with Rainmeter. Any hints or tips highly appreciated.

Thanks
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Downloading and updating satelite images

Post by balala »

Matth wrote:I guess it is possible to parse the page with the files (http://www.data.jma.go.jp/mscweb/data/himawari/list_fd_.html) every 10 minutes and download all the files and display them.
Download all those files? Don't! There are so many as you can't download all of them.
I think instead, you should download just the needed image(s). Eg, take a look at the following code:

Code: Select all

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

[Variables]
Item=<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>.*<td><a href=.*>(.*)</td>

[MeasureData]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/list_fd_.html
RegExp=(?siU)<tr><td rowspan=2>(.*)</td>.*#Item#.*<tr><td rowspan=2>(.*)</td>.*#Item#
FinishAction=[!EnableMeasure "MeasureImage"][!CommandMeasure "MeasureImage" "Update"]

[MeasureTime1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=1

[Measure1Image01]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=2

[Measure1Image02]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=3

[Measure1Image03]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=4

[Measure1Image04]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=5

[Measure1Image05]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=6

[Measure1Image06]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=7

[Measure1Image07]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=8

[Measure1Image08]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=9

[Measure1Image09]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=10

[Measure1Image10]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=11

[Measure1Image11]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=12

[Measure1Image12]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=13

[Measure1Image13]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=14

[Measure1Image14]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=15

[Measure1Image15]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=16

[Measure1Image16]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=17

[MeasureTime2]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=18

[Measure2Image01]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=19

[Measure2Image02]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=20

[Measure2Image03]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=21

[Measure2Image04]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=22

[Measure2Image05]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=23

[Measure2Image06]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=24

[Measure2Image07]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=25

[Measure2Image08]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=26

[Measure2Image09]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=27

[Measure2Image10]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=28

[Measure2Image11]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=29

[Measure2Image12]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=30

[Measure2Image13]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=31

[Measure2Image14]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=32

[Measure2Image15]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=33

[Measure2Image16]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=34

[MeasureImage]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/[&Measure1Image01]
Download=1
DynamicVariables=1
Disabled=1
FinishAction=[!ShowMeter "MeterImage"]

[MeterImage]
Meter=Image
MeasureName=MeasureImage
X=0
Y=0
W=150
H=150
PreserveAspectRatio=1
Hidden=1
The [Measure1Image01] - [Measure2Image16] measures will get the URLs of the appropriate images. With the above code, these images are those listed into the first two rows (for 00:00 UTC and 00:10 UTC respectively). From these URLs, the [MeasureImage] measure downloads one image. I chose the first one, but this can be easily changed, changing the [&Measure1Image01] part of the Url option (if you do so, be careful to not remove the &). Finally, the downloaded image is shown by the [MeterImage] meter.
Matth wrote:Since each file only gets updated once per day, I was wondering if it is possible to somehow just download the "latest" file and store it locally, until it gets overwritten again in 24 hours.
I'm not sure how you want to determine which image is the latest one. Based on the local time? I suppose this also can be done, just let's clarify these frist.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Downloading and updating satelite images

Post by Matth »

Wow that is awesome. Thank you very much.

Well, with the download all the images I meant to then create an animation to show the last 24 hours (or maybe the last 6 or so).

I tried to define the current time and download the "current" image. I created three measures for that:

[MeasureHour] = To get the current UTC hour
[MeasureMinute] = To get the current UTC minute
[MeasureMin] = To floor the current minute to 10 and use a 0 in front in case it's less than 10

Using a variable #UTCTime# I combined [MeasureHour] and [MeasureMin].

I added the #UTCTime# to the #Item# Variable to parse the images of that time.

If I define the #UTCTime# manually, it works. If I use the UTCTime=[MeasureHour][MeasureMin] then it fails. Even if it tells me, that the manual UTCTime and the concatenated one are equal.

And I'm not sure if the If condition for the MeasureMin is correct and working.

Code: Select all

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

[Variables]
UTCTime=0830
UTCTime2=[MeasureHour][MeasureMin]
Item=<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>

[MeasureHour]
Measure=Time
Format=%H
TimeZone=0
DynamicVariables=1

[MeasureMinute]
Measure=Time
Format=%M
TimeZone=0
DynamicVariables=1

[MeasureMin]
Measure=Calc
Formula=(MeasureMinute < 10 ? [MeasureMinute] : (Floor([MeasureMinute]/10)*10))
DynamicVariables=1

[MeasureData]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/list_fd_.html
;RegExp=(?siU)<tr><td rowspan=2>(.*)</td>.*#Item#.*<tr><td rowspan=2>(.*)</td>.*#Item#
RegExp=(?siU)<tr><td rowspan=2>(.*)</td>.*#Item#
FinishAction=[!EnableMeasure "MeasureImage"][!CommandMeasure "MeasureImage" "Update"]

[MeasureTime1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=1

[Measure1Image01]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=2

[Measure1Image02]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=3

[Measure1Image03]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=4

[Measure1Image04]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=5

[Measure1Image05]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=6

[Measure1Image06]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=7

[Measure1Image07]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=8

[Measure1Image08]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=9

[Measure1Image09]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=10

[Measure1Image10]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=11

[Measure1Image11]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=12

[Measure1Image12]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=13

[Measure1Image13]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=14

[Measure1Image14]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=15

[Measure1Image15]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=16

[Measure1Image16]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=17

[MeasureImage]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/[&Measure1Image16]
Download=1
DynamicVariables=1
Disabled=1
FinishAction=[!ShowMeter "MeterImage"]

[MeterImage]
Meter=Image
MeasureName=MeasureImage
X=0
Y=0
W=200
H=200
PreserveAspectRatio=1
Hidden=1
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Downloading and updating satelite images

Post by Matth »

After some more trial and error, I seem to have found the solution to get always the current image. Here's the code now:

Code: Select all

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

[Variables]
;UTCTime=0000
;Item=<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>.*<td><a href=.*#UTCTime#.jpg>(.*)</td>

[MeasureHour]
Measure=Time
Format=%H
TimeZone=0
DynamicVariables=1

[MeasureMinute]
Measure=Time
Format=%M
TimeZone=0
DynamicVariables=1

[MeasureMin]
Measure=Calc
Formula=(Floor([MeasureMinute]/10)*10)
DynamicVariables=1
IfCondition=MeasureMin < 10
IfTrueAction=[!SetVariable Item "<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMinute].jpg>(.*)</td>"]
IfFalseAction=[!SetVariable Item "<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>"]

[MeasureData]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/list_fd_.html
RegExp=(?siU)<tr><td rowspan=2>(.*)</td>.*#Item#
FinishAction=[!EnableMeasure "MeasureImage"][!CommandMeasure "MeasureImage" "Update"]
DynamicVariables=1

[MeasureTime1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=1

[Measure1Image01]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=2

[Measure1Image02]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=3

[Measure1Image03]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=4

[Measure1Image04]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=5

[Measure1Image05]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=6

[Measure1Image06]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=7

[Measure1Image07]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=8

[Measure1Image08]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=9

[Measure1Image09]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=10

[Measure1Image10]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=11

[Measure1Image11]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=12

[Measure1Image12]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=13

[Measure1Image13]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=14

[Measure1Image14]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=15

[Measure1Image15]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=16

[Measure1Image16]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=17

[MeasureImage]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/[&Measure1Image16]
Download=1
DynamicVariables=1
Disabled=1
FinishAction=[!ShowMeter "MeterImage"]

[MeterImage]
Meter=Image
MeasureName=MeasureImage
X=0
Y=0
W=200
H=200
PreserveAspectRatio=1
Hidden=1

User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Downloading and updating satelite images

Post by balala »

A while ago, here was a somehow similar discussion, when vHAPpY asked help, to download images of Hiamwari and create an animation. Here is that discussion: https://forum.rainmeter.net/viewtopic.php?p=129919#p129919, but the thread is too long, if you want to browse it, I think you'll have to read a lot.
Matth wrote:Well, with the download all the images I meant to then create an animation to show the last 24 hours (or maybe the last 6 or so).
But even in this case, you don't have to download all images, because for each moment, there are images taken into different spectra, so, I think would be a much better idea, to choose one and download just the appropriate images.
Matth wrote:After some more trial and error, I seem to have found the solution to get always the current image.
Ok, but that's not an animation, it shows just one single image. Are still interested to create an animation?

Sorry for included both your replies, I already started writing mine, when you posted your last one.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Downloading and updating satelite images

Post by Matth »

Hi

I will have a look at it probably a bit later. I am already happy so far with the current result.

I guess, I should be more precise with my statements. When I meant all the images, I meant all the images of one type (i.e. TRM/True Color Reproduction). So it would be max. 144 images that I was talking about (24 * 6).

Code: Select all

IfTrueAction=[!SetVariable Item "<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>"]
And I also realized, that the above code didn't work at the full hour. With the change to the line above, it does.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Downloading and updating satelite images

Post by balala »

Matth wrote:I guess, I should be more precise with my statements. When I meant all the images, I meant all the images of one type (i.e. TRM/True Color Reproduction). So it would be max. 144 images that I was talking about (24 * 6).
I think that's still too much, but finally probably can be made to work.
Matth wrote:

Code: Select all

IfTrueAction=[!SetVariable Item "<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>"]
And I also realized, that the above code didn't work at the full hour. With the change to the line above, it does.
I have to understand that this is working well now?
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Downloading and updating satelite images

Post by Matth »

Yes, it's working. It updates the image every 10 minutes and I see the "current" view of my side of the world in real time :D
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Downloading and updating satelite images

Post by balala »

Ok, I'm glad.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Downloading and updating satelite images

Post by Matth »

I guess I was a bit overly enthusiastic with my judgement that it works just fine.

While I can round down the minutes to the previous 10 minutes during the hour, I need to have a special case for the full hour "00" to get the double zero. Initially I tried with a IfCondition, but that didn't seem to work as intended. I changed it now to an IfEqualValue=0 and IfAboveValue=0 but for some reason it only works once. It changes the #Item# variable from %H00 to %H10, but after that, the variable no longer gets changed. It basically is stuck at 1410 (or 1510, 1610, etc.) for the rest of the hour.

Why is the check IfAboveValue=0 not triggering the !SetVariable Item ... anymore?

Code: Select all

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

[Variables]

[MeasureHour]
Measure=Time
Format=%H
TimeZone=0
DynamicVariables=1

[MeasureMinute]
Measure=Time
Format=%M
TimeZone=0
DynamicVariables=1

[MeasureMin]
Measure=Calc
Formula=(Floor([MeasureMinute]/10)*10)
Group=Imgs
DynamicVariables=1
IfEqualValue=0
IfEqualAction=[!SetVariable Item "<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>.*<td><a href=.*[MeasureHour]00.jpg>(.*)</td>"]
IfAboveValue=0
IfAboveAction=[!SetVariable Item "<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>.*<td><a href=.*[MeasureHour][MeasureMin].jpg>(.*)</td>"]

[MeasureData]
Measure=Plugin
Plugin=WebParser
UpdateRate=600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/list_fd_.html
RegExp=(?siU)<tr><td rowspan=2>(.*)</td>.*#Item#
FinishAction=[!EnableMeasure "MeasureImage"][!CommandMeasure "MeasureImage" "Update"][!UpdateMeasure "MeasureMin"]
DynamicVariables=1

[MeasureTime1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=1

[Measure1Image01]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=2

[Measure1Image02]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=3

[Measure1Image03]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=4

[Measure1Image04]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=5

[Measure1Image05]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=6

[Measure1Image06]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=7

[Measure1Image07]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=8

[Measure1Image08]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=9

[Measure1Image09]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=10

[Measure1Image10]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=11

[Measure1Image11]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=12

[Measure1Image12]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=13

[Measure1Image13]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=14

[Measure1Image14]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=15

[Measure1Image15]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=16

[Measure1Image16]
Measure=Plugin
Plugin=WebParser
Url=[MeasureData]
StringIndex=17

[MeasureImage]
Measure=Plugin
Plugin=WebParser
UpdateRate=3600
Url=http://www.data.jma.go.jp/mscweb/data/himawari/[&Measure1Image16]
Download=1
DynamicVariables=1
Disabled=1
FinishAction=[!ShowMeter "MeterImage"]
Group=Imgs

[MeterImage]
Meter=Image
MeasureName=MeasureImage
X=0
Y=0
W=200
H=200
PreserveAspectRatio=1
Hidden=1

[MeterTime]
Meter=String
Text=[MeasureHour]:[MeasureMin],[Measure1Image16]
FontColor=255,255,255,255
Y=200
AntiAlias=1
DynamicVariables=1

At the bottom of the code I have the MeterTime meter to display the values to check.
Post Reply