It is currently May 6th, 2024, 8:10 pm
Get help with creating, editing & fixing problems with skins
aidayong
Posts: 18 Joined: June 22nd, 2011, 7:59 am
Post
by aidayong » June 27th, 2011, 3:13 am
i like to display weather for multiple locations
OPTION 1
Write individual measure & meter for each location and used the enabled & hide !bang
Code: Select all
eg
[Weather 1]
Plugin=Plugins\WebParser.dll
URL=http://xml.weather.com/weather/local/MYXX0011?cc=*&unit=m&dayf=3
UpdateRate=6000
Debug=1
Download=1
DownloadFile=weather.txt
DynamicVariables=1
Group= 1
[Weather 2]
Plugin=Plugins\WebParser.dll
URL=http://xml.weather.com/weather/local/MYXX0013?cc=*&unit=m&dayf=3
UpdateRate=6000
Debug=1
Download=1
DownloadFile=weather.txt
DynamicVariables=1
Group= 1
OPTION 2
Write a measure variable that display the weather based on the button i click.. without writing individual measure/meter
Code: Select all
[dest]
Measure=Calc
Formula=#vchange#
Substitute="1":"http://xml.weather.com/weather/local/MYXX0011?cc=*&unit=m&dayf=3","2":"http://xml.weather.com/weather/local/MYXX0013?cc=*&unit=m&dayf=3"
;dest1=MYXX0011;dest2=MYXX0013;dest3=MYXX0008
DynamicVariables=1
[MeasureWeatherXML]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=dest
Debug=1
Download=1
DownloadFile=weather.txt
DynamicVariables=1
Group= 1
I have been unsuccessful with option 2. Option 1 works but is runs my CPU heavily. any advise...
smurfier
Moderator
Posts: 1931 Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN
Post
by smurfier » June 27th, 2011, 3:23 am
Option 2 does not work because plugins cannot use dynamic variables.
GitHub |
DeviantArt |
Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
aidayong
Posts: 18 Joined: June 22nd, 2011, 7:59 am
Post
by aidayong » June 27th, 2011, 3:30 am
smurfier wrote: Option 2 does not work because plugins cannot use dynamic variables.
ahh bugger...
i seen hud vision weather using regexp file to change the location..but i not familiar with coding regexp file..is there another option?
smurfier
Moderator
Posts: 1931 Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN
Post
by smurfier » June 27th, 2011, 4:21 am
!RainmeterWriteKeyValue [Section] [Key] [Value] ("FileSpec")
Use !RainmeterWriteKeyValue to write a different url to a variable, then use !RainmeterRefresh to reload the skin using the new value. This bipasses the dynamic variables issue but does give a bit of a lag as the skin first refreshes then the measures retrieve the weather feed.
GitHub |
DeviantArt |
Tumblr
This is the song that never ends. It just goes on and on my friends. Some people started singing it not knowing what it was, and they'll continue singing it forever just because . . .
GHOST®
Posts: 55 Joined: March 11th, 2011, 6:33 pm
Location: Garden City, MI
Post
by GHOST® » June 27th, 2011, 4:29 am
EDIT** DOH!!! Smurfier beat me too the punch, ah well. Went through the effort to post this, and he says in less than a sentance what I couldnt get across with a small novel. ;o)
aidayong wrote: i like to display weather for multiple locations
OPTION 2
Write a measure variable that display the weather based on the button i click.. without writing individual measure/meter
Code: Select all
[dest]
Measure=Calc
Formula=#vchange#
Substitute="1":"http://xml.weather.com/weather/local/MYXX0011?cc=*&unit=m&dayf=3","2":"http://xml.weather.com/weather/local/MYXX0013?cc=*&unit=m&dayf=3"
;dest1=MYXX0011;dest2=MYXX0013;dest3=MYXX0008
DynamicVariables=1
[MeasureWeatherXML]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=dest
Debug=1
Download=1
DownloadFile=weather.txt
DynamicVariables=1
Group= 1
I have been unsuccessful with option 2. Option 1 works but is runs my CPU heavily. any advise...
I, just this very day, did what you're trying to do with Option 2 to my RSS Feeder. Basically you need to set a Main URL Variable with your other URLs set up as their own Variables. Then via a button click, a RainmeterWriteKeyValue writes in the next weather variable into the Main URL Variable and refreshes the skin.
The 1st spoiler is the code for an RSS feed as I mentioned, the second Spoiler is a snippet of the Variables, as they are in a separate .inc file. The important parts are in
BOLD , (Dont forget to scroll to the bottom of the script, the buttons to change the Feeds are there), & hopefully they will help you along the path you're wishing to traverse. :o)
;[;+++SlideShow_Variables-------------------------------------------------------------]
ImageSC1=127,0,0
ImageSC1A=000001
ImageSC2=255,255,255
ImageSC2A=000001
ImageHrz=242,255,3
ImageVrt=251,255,3
ImageText=163,163,3
ImageFrame=127,0,0,200
ImageSize=0
ImagePath=C:\Users\GHOST\Pictures
ImgAlpha=255
SubFldr=1
UDDvide=20
;[;+++RSSFeeds_Variables-------------------------------------------------------------]
RSS01=http://forum.rainmeter.net/rss.php
RSS02=http://www.zeitnews.org/component/option,com_ninjarsssyndicator/feed_id,1/format,raw/
RSS03=http://feeds.feedburner.com/Greenpacks
RSS04=http://www.democracynow.org/democracynow.rss
RSS05=http://www.nanotech-now.com/rss/recentnews
RSS06=http://www.space.com/home/feed/site.xml
RSSURL=http://forum.rainmeter.net/rss.php
RSSActive=17
RSSRegExp="(?siU)<title.*>(.*)</title>.*<link.*>(.*)</link>.*<item.*<title.*>(.*)</title>.*<link.*>(.*)</link>(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)(?(?=.*<item).*<title.*>(.*)</title>.*<link.*>(.*)</link>)"
RSSSub="":" • • • •", """:'"', "&":'&', "<![CDATA[":"","]]>":"", "£":"£", "®":"®", "…":"…", "–":"–", """:'"', "'":'"', "ä":"ä", "é":"é", "ö":"ö", "’":"'", "“":"'", "”":"'", "é":"'", "&":"&", "ˆ":"ˆ", "–":"-", "—":"—", "™":"™", "°":"°"
"Do you want to be healed, now? Or would you prefer to bleed to death so I can try my hand at resurrection?"
aidayong
Posts: 18 Joined: June 22nd, 2011, 7:59 am
Post
by aidayong » June 27th, 2011, 6:44 am
Smurfier & Ghost...The rainmeterwritekeyvalue works like a charm..
Code: Select all
[Variables]
@include1=#SKINSPATH#5 - Yellow\YellowWeather\Variables.inc
LOC01On=!Execute [!RainmeterWriteKeyValue Variables RSSURL #LOC01# "#SKINSPATH#5 - Yellow\YellowWeather\Variables.inc"][!RainmeterRefresh]
LOC02On=!Execute [!RainmeterWriteKeyValue Variables RSSURL #LOC02# "#SKINSPATH#5 - Yellow\YellowWeather\Variables.inc"][!RainmeterRefresh]
LOC03On=!Execute [!RainmeterWriteKeyValue Variables RSSURL #LOC03# "#SKINSPATH#5 - Yellow\YellowWeather\Variables.inc"][!RainmeterRefresh]
[MeasureWeatherXML]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=#RSSURL#
;UpdateRate=6000
Debug=1
Download=1
DownloadFile=weather.txt
Group= 1
[LOC1CLICK]
Meter=STRING
MeterStyle=LabelStyle
Text=KUCHING
X=140r
Y=r
FontSize=9
LeftMouseDownAction=#LOC01On#
[LOC2CLICK]
Meter=STRING
MeterStyle=LabelStyle
Text=MELAKA
X=r
Y=15r
FontSize=9
LeftMouseDownAction=#LOC02On#
[LOC3CLICK]
Meter=STRING
MeterStyle=LabelStyle
Text=KUALALUMPUR
X=r
Y=15r
FontSize=9
LeftMouseDownAction=#LOC03On#
inc file..
Code: Select all
[Variables]
RSSURL=http://xml.weather.com/weather/local/MYXX0013?cc=*&unit=m&dayf=3
LOC01=http://xml.weather.com/weather/local/MYXX0011?cc=*&unit=m&dayf=3
LOC02=http://xml.weather.com/weather/local/MYXX0013?cc=*&unit=m&dayf=3
LOC03=http://xml.weather.com/weather/local/MYXX0008?cc=*&unit=m&dayf=3
thanks a lot.. this approach works much better than mine.