It is currently April 26th, 2024, 1:31 pm

Adding a proper link to your AccuWeather skin

Tips and Tricks from the Rainmeter Community
sgtevmckay

Adding a proper link to your AccuWeather skin

Post by sgtevmckay »

Ok, to address a static URL link to the AccuWeather page.

We are required to have at least one (1) of the six (6) available URL links to AccuWeather as part of every skin.

So I have a solution, until we can use parse links directly :D

After having tested 20 random location XML's the following URL is common to all AccuWeather XML And can be linked to from the US end as well. The US XML was the only exception!
But the following code will redirect to US locations, so this is the one to go with.

In the image area, most skin builder place a link to the weather site in question, I have seen no exception to this, so we shall continue the tradition :D

Using the HUD Vision Weather-One as an example, we need to replace a simple URL line.

As follows:
[i.dnes]
Hidden=1
MeasureName=m.i.dnes
Meter=IMAGE
X=12r
Y=0r
W=64
H=64
LeftMouseDownAction=!execute ["#eVIEWER#" "http://www.weather.com/outlook/travel/businesstraveler/local/#dest#"]

We need to change the URL in blue to the a new common URL, so I picked one that will deliver the skin user to AccuWeather.com and give the skin user the current weather conditions, instead of just popping in at the international page :D

Use this URL:

Code: Select all

http://www.accuweather.com/world-index-forecast.asp?partner=rainmeter&loccode=
Your new link will look like the following:
[i.dnes]
Hidden=1
MeasureName=MeasureCurIcon
Meter=IMAGE
X=12r
Y=0r
W=64
H=64
LeftMouseDownAction=!execute ["#eVIEWER#" "http://www.accuweather.com/world-index-forecast.asp?partner=rainmeter&loccode=#dest#]
This link will deliver you to a current weather page :!:

The red indicates the Location/destination that is located in your "Variables", or where ever you have the skin user place their destination code, Like so:

;Please replace your location code of Weather.com below, e.g: New York is USNY0996.
;You can check it on Weather.com or Google.
; define Fahrenheit and US system = 0 or Celsius and Metric system = 1
SCALE=1
; New York
dest=87505

This will meet AccuWeather.com's requirements nicely

If you have any questions, do not hesitate to ask :D
sgtevmckay

UPDATE / ADDITION

Post by sgtevmckay »

Once again

DragonMage Image

And Morely-Sama Image

Have saved me again.

Thanks to their intervention we now know how to utilize the static URL's drawn from the XML to use as links.

This opens a lot of doors, as these Links are drawn from the Parse and will direct folks to current and future forecast information :D

Mr. Morley's original post copied hear:

Here is how you do it...

Code: Select all

[MeasureAccuWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3000
Url=http://rainmeter.accu-weather.com/widget/rainmeter/weather-data.asp?Location=#Location#
RegExp="(?siU) isactive="(.*)">.*<currentconditions>.*<url>(.*)</url>.*<pressure state="(.*)".*>(.*)</pressure>.*<temperature>(.*)</temperature>.*<realfeel>(.*)</realfeel>.*<humidity>(.*)</humidity>.*<weathertext>(.*)</weathertext>.*<weathericon>(.*)</weathericon>.*<windspeed>(.*)</windspeed>.*<precip>(.*)</precip>"
So I go out to AccuWeather and get my current conditions. One of the things I return is the URL, in this case in StringIndex 2

01=> 0
02=> http://www.accuweather.com/index-forecast.asp?partner=rainmeter&zipcode=22033
03=> Decreasing
04=> 30.00
05=> 78
06=> 88
07=> 69%
08=> Sunny
09=> 01
10=> 3
11=> 0.00

So now let's get that URL into a measure all by itself, so we can use it anywhere.

Code: Select all

[MeasureWeatherURL]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureAccuWeather]
StringIndex=2
So this takes the result of StringIndex 2 from [MeasureAccuWeather] (our main RegExp measure) and puts it all by itself in [MeasureWeatherURL].

So we want to create a link for the URL, so the user goes there in their browser when it's clicked. I like to put the link on the weather "icon" so it's easy to click on.

Code: Select all

[MeasureIcon]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=[MeasureAccuWeather]
StringIndex=9

[MeterIcon]
MeasureName=MeasureIcon
Meter=IMAGE
X=68
Y=-10r
LeftMouseDownAction=!Execute ["[MeasureWeatherURL]"]
Done.. The meter for the icon has an !Execute statement that uses the URL stored in [MeasureWeatherURL] (NOTE THE QUOTES AROUND [MeasureWeatherURL], THEY ARE REQUIRED.)

Easy as can be... ;-)