It is currently March 28th, 2024, 10:40 pm
Get help with creating, editing & fixing problems with skins
matthewbuns
Posts: 2 Joined: January 24th, 2017, 3:39 am
Post
by matthewbuns » January 24th, 2017, 3:50 am
I'm brand new to Rainmeter meter making and I've been trying to pull images from NASA's
DSCOVR: EPIC API to make a daily Earth wallpaper, but I've been having problems with WebParser. I have a simple version working below, but it uses outdated API and doesn't allow the enhanced color images.
Code: Select all
[Rainmeter]
Update=1000
Debug=1
AccurateText=1
[Metadata]
Name=
Author=matthewbuns
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
[MeterString]
Meter=String
[MeasureImageName]
Measure=Plugin
Plugin=WebParser
URL=https://epic.gsfc.nasa.gov/api/natural
RegExp=(?siU)"image":"(.*)"
UpdateRate=600
StringIndex=1
[MeasureImageFile]
Measure=Plugin
Plugin=WebParser
URL=http://epic.gsfc.nasa.gov/epic-archive/png/[MeasureImageName].png
UpdateRate=600
StringIndex=1
Download=1
FinishAction=!SetWallpaper [MeasureImageFile] Fit
Below is the version that I have been having problems with, as it seems like you can't reference multiple measures in a string. It should be pulling the correct values, as I used RainRegEp. Thanks!
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Metadata]
Name=
Author=matthewbuns
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
[MeterString]
Meter=String
[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=https://epic.gsfc.nasa.gov/api/natural
RegExp=(?siU)"image":"(.*)".*"lat":(.*),.*"lon":(.*)}.*"date":"(.*) .*"date":"(.*)-.*"date":".*-(.*)-.*"date":".*-.*-(.*) .*"date":".* (.*)"
UpdateRate=600
[MeasureImageName]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=1
[MeasureImageLat]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=2
[MeasureImageLon]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=3
[MeasureImageDate]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=4
[MeasureImageYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=5
[MeasureImageMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=6
[MeasureImageDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=7
[MeasureImageTime]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=8
[MeasureImageFile]
Measure=Plugin
Plugin=WebParser
URL=http://epic.gsfc.nasa.gov/archive/natural/[MeasureImageYear]/[MeasureImageMonth]/[MeasureImageDay]/jpg/[MeasureImageName].jpg
UpdateRate=600
Download=1
FinishAction=!SetWallpaper [MeasureImageFile] Fit
Brian
Developer
Posts: 2673 Joined: November 24th, 2011, 1:42 am
Location: Utah
Post
by Brian » January 24th, 2017, 3:56 am
Referencing section variables with the URL option of the Webparser measure requires an extra
& character.
https://docs.rainmeter.net/manual/plugins/webparser/#URL
So you will probably have edit your URL like this:
Code: Select all
URL=http://epic.gsfc.nasa.gov/archive/natural/[&MeasureImageYear]/[&MeasureImageMonth]/[&MeasureImageDay]/jpg/[&MeasureImageName].jpg
However, since this measure depends on the results of another parent webparser measure, you may need to disable this measure initially and re-enable it (with the FinishAction option) on the other parent webparser measure.
Hopefully that makes sense.
-Brian
jsmorley
Developer
Posts: 22628 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » January 24th, 2017, 4:06 am
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Metadata]
Name=
Author=matthewbuns
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
[MeterString]
Meter=String
[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=https://epic.gsfc.nasa.gov/api/natural
RegExp=(?siU)"image":"(.*)".*"lat":(.*),.*"lon":(.*)}.*"date":"(.*) .*"date":"(.*)-.*"date":".*-(.*)-.*"date":".*-.*-(.*) .*"date":".* (.*)"
UpdateRate=600
FinishAction=[!EnableMeasure MeasureImageFile][!CommandMeasure MeasureImageFile "Update"][!UpdateMeasure MeasureImageFile]
[MeasureImageName]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=1
[MeasureImageLat]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=2
[MeasureImageLon]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=3
[MeasureImageDate]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=4
[MeasureImageYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=5
[MeasureImageMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=6
[MeasureImageDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=7
[MeasureImageTime]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=8
[MeasureImageFile]
Measure=Plugin
Plugin=WebParser
URL=http://epic.gsfc.nasa.gov/archive/natural/[&MeasureImageYear]/[&MeasureImageMonth]/[&MeasureImageDay]/jpg/[&MeasureImageName].jpg
DynamicVariables=1
UpdateRate=86400
Disabled=1
Download=1
FinishAction=!SetWallpaper [MeasureImageFile] Fit
DynamicVariables=1
matthewbuns
Posts: 2 Joined: January 24th, 2017, 3:39 am
Post
by matthewbuns » January 24th, 2017, 4:07 am
Brian wrote: Referencing section variables with the URL option of the Webparser measure requires an extra & character.
...
However, since this measure depends on the results of another parent webparser measure, you may need to disable this measure initially and re-enable it (with the FinishAction option) on the other parent webparser measure.
-Brian
I think I did it correctly, but all it's trying to do is get the image
http://epic.gsfc.nasa.gov/archive/natural////jpg/.jpg
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Metadata]
Name=
Author=matthewbuns
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
[MeterString]
Meter=String
[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=https://epic.gsfc.nasa.gov/api/natural
RegExp=(?siU)"image":"(.*)".*"lat":(.*),.*"lon":(.*)}.*"date":"(.*) .*"date":"(.*)-.*"date":".*-(.*)-.*"date":".*-.*-(.*) .*"date":".* (.*)"
UpdateRate=600
FinishAction=[!EnableMeasure MeasureImageFile]
[MeasureImageName]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=1
[MeasureImageLat]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=2
[MeasureImageLon]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=3
[MeasureImageDate]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=4
[MeasureImageYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=5
[MeasureImageMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=6
[MeasureImageDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=7
[MeasureImageTime]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=8
[MeasureImageFile]
Measure=Plugin
Plugin=WebParser
URL=http://epic.gsfc.nasa.gov/archive/natural/[&MeasureImageYear]/[&MeasureImageMonth]/[&MeasureImageDay]/jpg/[&MeasureImageName].jpg
UpdateRate=600
Download=1
Disabled=1
FinishAction=!SetWallpaper [MeasureImageFile] Fit
EDIT:
jsmorley wrote: Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[Metadata]
Name=
Author=matthewbuns
Information=
Version=
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0
[MeterString]
Meter=String
[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=https://epic.gsfc.nasa.gov/api/natural
RegExp=(?siU)"image":"(.*)".*"lat":(.*),.*"lon":(.*)}.*"date":"(.*) .*"date":"(.*)-.*"date":".*-(.*)-.*"date":".*-.*-(.*) .*"date":".* (.*)"
UpdateRate=600
FinishAction=[!EnableMeasure MeasureImageFile][!CommandMeasure MeasureImageFile "Update"][!UpdateMeasure MeasureImageFile]
[MeasureImageName]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=1
[MeasureImageLat]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=2
[MeasureImageLon]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=3
[MeasureImageDate]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=4
[MeasureImageYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=5
[MeasureImageMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=6
[MeasureImageDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=7
[MeasureImageTime]
Measure=Plugin
Plugin=WebParser
URL=[MeasureImage]
StringIndex=8
[MeasureImageFile]
Measure=Plugin
Plugin=WebParser
URL=http://epic.gsfc.nasa.gov/archive/natural/[&MeasureImageYear]/[&MeasureImageMonth]/[&MeasureImageDay]/jpg/[&MeasureImageName].jpg
DynamicVariables=1
UpdateRate=86400
Disabled=1
Download=1
FinishAction=!SetWallpaper [MeasureImageFile] Fit
DynamicVariables=1
That did it. Thanks so much!
Last edited by matthewbuns on January 24th, 2017, 4:08 am, edited 1 time in total.
jsmorley
Developer
Posts: 22628 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » January 24th, 2017, 4:08 am
jsmorley
Developer
Posts: 22628 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » January 24th, 2017, 4:10 am
Glad to help.
The key is that you are using those [&MeasureNames] as "section variables", and those will generally require DynamicVariables=1 on the measures or meters using them.
Brian
Developer
Posts: 2673 Joined: November 24th, 2011, 1:42 am
Location: Utah
Post
by Brian » January 24th, 2017, 4:12 am
I tried to mention that at the end of my last post, but I wasn't clear enough - I should have given you a quick example like jsmorley did.
Glad you got it working!
-Brian