It is currently May 6th, 2024, 8:10 pm

[Solved] multiple weather location

Get help with creating, editing & fixing problems with skins
aidayong
Posts: 18
Joined: June 22nd, 2011, 7:59 am

[Solved] multiple weather location

Post by aidayong »

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...
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: multiple weather location

Post by smurfier »

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

Re: multiple weather location

Post by aidayong »

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?
User avatar
smurfier
Moderator
Posts: 1931
Joined: January 29th, 2010, 1:43 am
Location: Willmar, MN

Re: multiple weather location

Post by smurfier »

!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 . . .
User avatar
GHOST®
Posts: 55
Joined: March 11th, 2011, 6:33 pm
Location: Garden City, MI

Re: multiple weather location

Post by GHOST® »

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)
[Rainmeter]
Author=GHOST®
AppVersion=2000000
BackGroundMode=1
Update=1000

Blur=#RSSBlur#
MouseOverAction=#!RmST# #RSSTrans1#
MouseLeaveAction=#!RmST# #RSSTrans2#

[Variables]
@include1=#SKINSPATH#My\Resources\Variables\MyStyles.inc
@include2=#SKINSPATH#My\Resources\Variables\MyVariables.inc

RSS01On=#!E# [#!RmWKV# Variables RSSURL #RSS01# "#incPath#"] [#!RmWKV# Variables RSSActive 17 "#incPath#"] [#!RmRF#]
RSS02On=#!E# [#!RmWKV# Variables RSSURL #RSS02# "#incPath#"] [#!RmWKV# Variables RSSActive 32 "#incPath#"] [#!RmRF#]
RSS03On=#!E# [#!RmWKV# Variables RSSURL #RSS03# "#incPath#"] [#!RmWKV# Variables RSSActive 47 "#incPath#"] [#!RmRF#]
RSS04On=#!E# [#!RmWKV# Variables RSSURL #RSS04# "#incPath#"] [#!RmWKV# Variables RSSActive 62 "#incPath#"] [#!RmRF#]
RSS05On=#!E# [#!RmWKV# Variables RSSURL #RSS05# "#incPath#"] [#!RmWKV# Variables RSSActive 77 "#incPath#"] [#!RmRF#]
RSS06On=#!E# [#!RmWKV# Variables RSSURL #RSS06# "#incPath#"] [#!RmWKV# Variables RSSActive 92 "#incPath#"] [#!RmRF#]


[+++Begin_RSS--------------------------------------------------------------]

[RSS_BackGround_STYL]
Meter=IMAGE
MeterStyle=RSS_BackGround_STYL
Group=X

[RSS_Icon.png]
Meter=IMAGE
ImageName=#RsrcPath#rss.png
GreyScale=#RSSGrey#
DynamicVariables=1
X=2
Y=2
W=24
Group=X

[RSS_Title_Hover]
Meter=Image
MeterStyle=RSS_HoverBar_STYL
X=31
Y=3r
W=140
H=20

[MSUR_RSS_Timer]
Measure=CALC
Formula=Counter %(#RSSIntrvl#+2)
MinValue=0
MaxValue=#RSSIntrvl#
IfAboveValue=#RSSIntrvl#
IfAboveAction=#RSSIfAbove#
Group=X

[MSUR_RSS_Feed]
Measure=PLUGIN
Plugin=Plugins\WebParser.dll
Url=#RSSURL#
RegExp=#RSSRegExp#
UpdateRate=#UpD8R8#
StringIndex=1
ForceReload=1
Substitute=#RSSSub#


[MSUR_RSS_URL]
Measure=PLUGIN
Plugin=Plugins\WebParser.dll
Url=[MSUR_RSS_Feed]
StringIndex=2
Substitute=#RSSSub#

[RSS_Title]
Meter=STRING
MeasureName=MSUR_RSS_Feed
MeterStyle=RSS_TextHead_STYL
X=r
Y=3r
LeftMouseUpAction=#!E# [PLAY #RsrcPath#ClickMe.wav] [[MSUR_RSS_URL]]
MouseOverAction=#!E# [#!RmSMt# RSS_Title_Hover] [#!RmRD#]
MouseLeaveAction=#!E# [#!RmHMt# RSS_Title_Hover] [#!RmRD#]
Group=X

[DividerLine_HrzLft]
Meter=IMAGE
SolidColor=#RSSInAct#,63.75
SolidColor2=#RSSInAct#,255
X=5
Y=23r
W=70
Group=X

[DividerLine_HrzRgt]
Meter=IMAGE
SolidColor=#RSSInAct#,63.75
SolidColor2=#RSSInAct#,255
GradientAngle=180
X=R
Y=r
W=70
Group=X

[+++RSS_Body--------------------------------------------------------------]

[RSS_Solid_01]
Meter=IMAGE
MeterStyle=RSS_LinkSolidColor_STYL
X=2
Y=42
MouseOverAction=#!E# [#!RmSMt# RSS_Hover_01][#!RmRD#]
MouseLeaveAction=#!E# [#!RmHMt# RSS_Hover_01][#!RmRD#]
Group=X

[RSS_Hover_01]
Meter=IMAGE
MeterStyle=RSS_HoverBar_STYL
X=1r
Y=1r
W=169
H=13

[MSUR_RSS_Item_01]
Measure=PLUGIN
Plugin=Plugins\WebParser.dll
Url=[MSUR_RSS_Feed]
StringIndex=3
Substitute=#RSSSub#

[MSUR_RSS_Link_01]
Measure=PLUGIN
Plugin=Plugins\WebParser.dll
Url=[MSUR_RSS_Feed]
StringIndex=4
Substitute=#RSSSub#

[RSS_Body_01]
Meter=STRING
MeterStyle=RSS_TextBody_STYL
MeasureName=MSUR_RSS_Item_01
ToolTipText=[MSUR_RSS_Item_01]
ToolTipHidden=#RSSTTH#
Y=1r
LeftMouseDownAction=#!E# [PLAY #RsrcPath#ClickMeSml.wav] [[MSUR_RSS_Link_01]]
Group=X


[RSS_Solid_02]
Meter=IMAGE
MeterStyle=RSS_LinkSolidColor_STYL
X=2
Y=58
MouseOverAction=#!E# [#!RmSMt# RSS_Hover_02][#!RmRD#]
MouseLeaveAction=#!E# [#!RmHMt# RSS_Hover_02][#!RmRD#]
Group=X

[RSS_Hover_02]
Meter=IMAGE
MeterStyle=RSS_HoverBar_STYL
X=1r
Y=1r
W=169
H=13

[MSUR_RSS_Item_02]
Measure=PLUGIN
Plugin=Plugins\WebParser.dll
Url=[MSUR_RSS_Feed]
StringIndex=5
Substitute=#RSSSub#

::Code Body snipped for brevity::


[Settings_LineLftTop]
Meter=IMAGE
MeterStyle=RSS_VrtLineTop_STYL
H=41
Hidden=1
Group=Settings
[Settings_LineLftBttm]
Meter=IMAGE
MeterStyle=RSS_VrtLineBttm_STYL
Y=40
H=41
Hidden=1
Group=Settings
[Settings_LineRgtTop]
Meter=IMAGE
MeterStyle=RSS_VrtLineTop_STYL
X=174r
H=41
Hidden=1
Group=Settings
[Settings_LineRgtBttm]
Meter=IMAGE
MeterStyle=RSS_VrtLineBttm_STYL
X=r
Y=40
H=41
Hidden=1
Group=Settings

[;+++RSS_Selection_Buttons-----------------------------------------------]

[RSS01_InActive]
Meter=IMAGE
ImageName=#RsrcPath#RSSInActive.png
ImageTint=#RSSInAct#
ImageAlpha=255
ToolTipText=#RSS01#
ToolTipHidden=#RSSTTH#
DynamicVariables=1
X=20
Y=24
LeftMouseUpAction=#RSS01On# [PLAY #RsrcPath#ClickMeSml.wav]
Group=X

[RSS02_InActive]
Meter=IMAGE
MeterStyle=RSS01_InActive
ToolTipText=#RSS02#
ToolTipHidden=#RSSTTH#
X=15r
Y=r
LeftMouseUpAction=#RSS02On# [PLAY #RsrcPath#ClickMeSml.wav]
Group=X

[RSS03_InActive]
Meter=IMAGE
MeterStyle=RSS01_InActive
ToolTipText=#RSS03#
ToolTipHidden=#RSSTTH#
X=15r
Y=r
LeftMouseUpAction=#RSS03On# [PLAY #RsrcPath#ClickMeSml.wav]
Group=X

[RSS04_InActive]
Meter=IMAGE
MeterStyle=RSS01_InActive
ToolTipText=#RSS04#
ToolTipHidden=#RSSTTH#
X=15r
Y=r
LeftMouseUpAction=#RSS04On# [PLAY #RsrcPath#ClickMeSml.wav]
Group=X

[RSS05_InActive]
Meter=IMAGE
MeterStyle=RSS01_InActive
ToolTipText=#RSS05#
ToolTipHidden=#RSSTTH#
X=15r
Y=r
LeftMouseUpAction=#RSS05On# [PLAY #RsrcPath#ClickMeSml.wav]
Group=X

[RSS06_InActive]
Meter=IMAGE
MeterStyle=RSS01_InActive
ToolTipText=#RSS06#
ToolTipHidden=#RSSTTH#
X=15r
Y=r
LeftMouseUpAction=#RSS06On# [PLAY #RsrcPath#ClickMeSml.wav]
Group=X

[RSS_Active_Indicator]
Meter=IMAGE
ImageName=#RsrcPath#RSSActive.png
ImageTint=#RSSActiv#
ImageAlpha=200
DynamicVariables=1
X=#RSSActive#
Y=21
W=21
H=21
Group=X
;[;+++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[":"","]]>":"", "&#xA3;":"£", "&#xAE;":"®", "&#8230;":"…", "&#8211;":"–", """:'"', "'":'"', "&#228;":"ä", "&#233;":"é", "&#246;":"ö", "&#x92;":"'", "&#x93;":"'", "&#x94;":"'", "&#xE9;":"'", "&":"&", "&#x88;":"ˆ", "&#x96;":"-", "&#x97;":"—", "&#x99;":"™", "&#xB0;":"°"
"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

Re: multiple weather location

Post by aidayong »

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.