It is currently March 29th, 2024, 10:23 am

help me with lampo weather

Get help with creating, editing & fixing problems with skins
Ruba
Posts: 4
Joined: October 13th, 2021, 1:00 pm

help me with lampo weather

Post by Ruba »

Hi I want someone can help me with Lampo weather https://www.deviantart.com/apexxx-sensei/art/Lampo-798930945 as u know he always use wxdata.weather.com it doesn't work in my location so i changed to yahoo.com/news/weather it worked but the wind section didn't .I don't know where is the mistak i'm not a programmer or do coding but i copy paste from other skin as Weather Alternative . the sentence should be like this :
Today's weather is sunny with temperature of 22c Humidity 78% and wind speed ....
I will be greatful if anyone can help me or fix it thank u

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
@Include3=#@#WXDataWeatherRegExp.inc
Scale=1.15

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureWeather]
Measure=Plugin
Plugin=WebParser
Url=https://www.yahoo.com/news/weather/syria/dimashq/damascus-1947122
RegExp=(?siU)<h1 class="city.*data-reactid="7">(.*)</h1>.*data-reactid="8">(.*)</div></div></div><div.*<div class="My\(2px\).*60x60\/(.*)@2x.png.*data-reactid="26">(.*)<.*<span class="Va\(m\) Px\(6px\)" data-reactid="29"><\!-- react-text: 30 -->(.*)<.*data-reactid="33"><\!-- react-text: 34 -->(.*)<.*<span class="Va\(t\)" data-reactid="37">(.*)</span>.*data-reactid="477">(.*)°</div></li><li.*Humidity.*data-reactid="480">(.*)</div>.*
UpdateRate=900


;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureTempUnit]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureCurrent]
StringIndex=1]



[MeasureLocation]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWeather]
StringIndex=1
DynamicVariables=1

[MeasureCountry]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeather]
StringIndex=2

[MeasureWeatherIcons]
Measure=Plugin
Plugin=WebParser
URL=[MeasureWeather]
StringIndex=2
DynamicVariables=1
Substitute="rain_day_night":"rain","scattered_showers_day_night":"rain","windy_day_night":"wind","mostly_cloudy_day_night":"cloudy","cloudy_day_night":"cloudy","snow_rain_mix_day_night":"sleet","fair_day":"clear_day","fair_night":"clear_night","flurries_day_night":"snow","snow_day_night":"snow","thundershowers_day_night":"rain","fog_day_night":"fog"Substitute="rain_day_night":"rain","scattered_showers_day_night":"rain","windy_day_night":"wind","mostly_cloudy_day_night":"cloudy","cloudy_day_night","PartlyCloudy_day_night:"cloudy",
"snow_rain_mix_day_night":"sleet","fair_day":"clear_day","fair_night":"clear_night","flurries_day_night":"snow","snow_day_night":"snow","thundershowers_day_night":"rain","fog_day_night":"fog"


[MeasureDescription]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeather]
StringIndex=4
Substitute=#Conditions#

[MeasureTempFahrenheit]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeather]
StringIndex=7

[MeasureFeelLikeFahrenheit]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeather]
StringIndex=8


[MeasureFeelLikeCelsius]
Measure=Calc
Formula=Round((MeasureFeelLikeFahrenheit-32)*5/9)
DynamicVariables=1
Substitute="-18":""

[MeasureTempCelsius]
Measure=Calc
Formula=Round((MeasureTempFahrenheit-32)*5/9)
DynamicVariables=1
Substitute="-18":""

[MeasureHumidity]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeather]
StringIndex=9

[MeasureWind]
Measure=Plugin
Group=Weather
Plugin=WebParser
URL=[MeasureWeather]
RegExp=#CurrentWind#
Disabled=1

[MeasureWindSpeed]
Measure=Plugin
Group=Weather
Plugin=WebParser
URL=[MeasureWind]
StringIndex=1
Disabled=1
IfCondition=CurrentWindSpeedChild = 0
IfTrueAction=[!SetOption MeterCurrentWind Text "%1"]
IfFalseAction=[!SetOption MeterCurrentWind Text "%1 [*UnitsSpeedChild*]"]

[MeasureWindUnit]
Measure=Plugin
Group=Weather
Plugin=WebParser
URL=[MeasureTempUnit]
StringIndex=5
Disabled=1

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentIcon]
Meter=Image
MeasureName=MeasureWeatherIcons
ImagePath=#@#Weather Icons
X=(160*#Scale#)
Y=(0*#Scale#)
W=(80*#Scale#)
ImageTint=#Color1#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterWeatherInfo]
Meter=String
MeasureName=MeasureDescription
MeasureName2=MeasureTempCelsius
MeasureName3=MeasureFeelLikeCelsius
StringAlign=Center
FontFace=Roboto Light
FontColor=#Color1#
FontSize=(10*#Scale#)
X=(200*#Scale#)
Y=(80*#Scale#)
Text="#Today's weather is# %1 #with temperature of# %2°C."
AntiAlias=1

[MeterHumAndWindInfo]
Meter=String
MeasureName=MeasureHumidity
MeasureName2=MeasureWindSpeed
MeasureName3=MeasureWindUnit
StringAlign=Center
FontFace=Roboto Light
FontColor=#Color1#,150
FontSize=(10*#Scale#)
X=(0*#Scale#)r
Y=(0*#Scale#)R
Text="#Humidity is# %1  #and wind speed is# %2 %3."
AntiAlias=1
You do not have the required permissions to view the files attached to this post.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: help me with lampo weather

Post by SilverAzide »

Your best bet is to use weather.com. Yahoo is a poor source for weather these days.

The instructions in this guide will help you retrofit your skin to use TWC:

Step-by-Step Basic Weather Skin Tutorial
Gadgets Wiki GitHub More Gadgets...
Ruba
Posts: 4
Joined: October 13th, 2021, 1:00 pm

Re: help me with lampo weather

Post by Ruba »

thank u i will try it now :bow:
Huntsman2
Posts: 2
Joined: December 18th, 2022, 4:19 pm

Re: help me with lampo weather

Post by Huntsman2 »

That link points to a very informative tutorial.

It seems to difficult for me to do ;(

Has anyone fixed the Weather.info.ini in Lampo, so I can just copy and paste working code in?
Ruba
Posts: 4
Joined: October 13th, 2021, 1:00 pm

Re: help me with lampo weather

Post by Ruba »

Huntsman2 wrote: December 18th, 2022, 4:47 pm That link points to a very informative tutorial.

It seems to difficult for me to do ;(

Has anyone fixed the Weather.info.ini in Lampo, so I can just copy and paste working code in?
the temperature works but wind speed and humidity don't work
Ruba
Posts: 4
Joined: October 13th, 2021, 1:00 pm

Re: help me with lampo weather

Post by Ruba »

Code: Select all

[Rainmeter]
Update=1000
Author=Connect-R
BackgroundMode=2
SolidColor=0,0,0,1
DynamicWindowSize=1
AccurateText=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh] 
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 0.2 ? 0.2 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
@Include3=#@#WXDataWeatherRegExp.inc
Scale=1.05

;-------------------------------------------------------------
;-------------------------------------------------------------


[MeasureCheckNetwork]
Measure=Plugin
Plugin=SysInfo
SysInfoType=INTERNET_CONNECTIVITY
SysInfoData=Best
OnChangeAction=[!CommandMeasure MeasureCurrent "Update"][!CommandMeasure MeasureUnits "Update"]

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureCurrent]
Measure=Plugin
Plugin=WebParser.dll
Url=https://www.yahoo.com/news/weather/syria/dimashq/damascus-1947122
RegExp=(?siU)Wob\(ba\)">(.*)<.*Trsdu\(\.3s\)">.*<.*60x60\/(.*)@2x.png.*Fz\(1\.12rem\)">(.*)<.*".*celsius_D\(n\)">(.*)&deg;<.*celsius_D\(n\)">(.*)&deg;<.*celsius_D\(n\)">(.*)<.*RealFeel.*celsius_D\(n\)">(.*)&deg;<
UpdateRate=900

[MeasureUnits]
Measure=Plugin
Plugin=WebParser.dll
UpdateRate=900
Url=https://www.yahoo.com/news/weather/syria/dimashq/damascus-1947122
RegExp="(?siU)<div class="wind".*data-reactid="455">(.*)</span>.*data-reactid="457">(.*)</span>.*<!-- react-text: 458 -->(.*)<!-- /react-text -->.*<div class="Fl\(start\)".*data-reactid="479">(.*)</div>.*data-reactid="480">(.*)</div>.*"

;-------------------------------------------------------------
;-------------------------------------------------------------



;-------------------------------------------------------------
;-------------------------------------------------------------
[MeasureLocation]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureCurrent]
StringIndex=1

[MeasureWeatherCond]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureCurrent]
StringIndex=2
Substitute=#Conditions#

[MeasureWeatherIcons]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureCurrent]
StringIndex=3
DynamicVariables=1
Substitute="rain_day_night":"rain","scattered_showers_day_night":"rain","windy_day_night":"wind","mostly_cloudy_day_night":"cloudy","cloudy_day_night":"cloudy","Partly Cloudy_day_night:"cloudy","snow_rain_mix_day_night":"sleet","fair_day":"clear_day","fair_night":"clear_night","flurries_day_night":"snow","snow_day_night":"snow","thundershowers_day_night":"rain","fog_day_night":"fog"

[MeasureWeatherTemp]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureCurrent]
StringIndex=4


[MeasureHum]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureUnits]
StringIndex=5

[MeasureWindSpeed]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureUnits]
StringIndex=6

[MeasureWindUnit]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureUnits]
StringIndex=7

;[MeasureWindUnit2]
;Measure=Plugin
;Plugin=WebParser.dll
;Url=[MeasureUnits]
;StringIndex=8

[MeasureTempUnit]
Measure=Plugin
Plugin=WebParser.dll
Url=[MeasureCurrent]
StringIndex=9
;Substitute="F":"f","C":"c"
Substitute="F":"c"

[MeasureTempCelcius]
Measure=Calc
Formula=Round((MeasureWeatherTemp-32)*5/9)
DynamicVariables=1

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterCurrentIcon]
Meter=Image
MeasureName=MeasureWeatherIcons
ImagePath=#@#Weather Icons
X=(180*#Scale#)
Y=(25*#Scale#)
W=(50*#Scale#)
ImageTint=#Color1#

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeterWeatherInfo]
Meter=String
MeasureName=MeasureWeatherCond
MeasureName2=MeasureTempCelcius
MeasureName3=MeasureTempUnit
StringAlign=Center
FontFace=Roboto Light
FontColor=#Color1#
FontSize=(10*#Scale#)
X=(200*#Scale#)
Y=(80*#Scale#)
Text="#Today's weather is# %1 #with temperature of# %2° %3."
AntiAlias=1

[MeterHumAndWindInfo]
Meter=String
MeasureName=MeasureHum
MeasureName2=MeasureWindSpeed
MeasureName3=MeasureWindUnit2
StringAlign=Center
FontFace=Roboto Light
FontColor=#Color1#,150
FontSize=(10*#Scale#)
X=(0*#Scale#)r
Y=(0*#Scale#)R
Text="#Humidity is# %1 #and wind speed is# %2."
AntiAlias=1
Last edited by balala on December 18th, 2022, 5:59 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are posting codes. It's the </> button.
Huntsman2
Posts: 2
Joined: December 18th, 2022, 4:19 pm

Re: help me with lampo weather

Post by Huntsman2 »

Yes that works, thank you.
I just need to find how to hard code the location, because the location must change somehow because doing a refresh changes the display for a few seconds then reverts back to another location.

I notice that Yahoo uses AccuWeather.
"https://www.accuweather.com/en/gb/"location"/weather-forecast/326916" />
So I wonder if you coding guys/gals would be better using the source forecaster?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: help me with lampo weather

Post by eclectic-tech »

Note: In mid=December 2022 Yahoo changed their website and most weather skins that parsed details by scraped the HTML code stopped working. The site no longer presents data in a webparser enabled format; it uses scripts to populate the webpage.

In order to have those skins display information, they need to be converted to use Weather.com data.

To convert requires downloading the weather files needed and extracting them to the @Resources folder of your Yahoo weather skin.
If there is no @Resources folder, you need to create one at the root-level of your skin e.g.; Skins\MySkinFolder\@Resources.

Those extracted files contain all of the Variables and Measures needed to acquire the weather data from Weather.com.
For most conversions, you are only going to use 2 of those files: WeatherComVariables.inc and WeatherComJSONMeasures3Day.inc

Basically, there are only a few steps to utilize these files:
1.) include the new variables and measures in your skin code
2.) Eliminate the Yahoo weather measures in the code (comment or delete them)
3.) Change the MeasureName= references in your meters to use the new measures

Lampo's 'Weather Info.ini' file must be edited to use the new variables and measures. Open that file in your text editor.
To add the new variables data use @include line in the [Variables] section and add another @include line below all existing variables to add the measures:

Code: Select all

[Variables]
@include=#@#Variables.inc
@include2=#@#Language\Language.inc
@Include3=#@#WeatherComJSONVariables.inc
Scale=1.15

;-------------------------------------------------------------

@include4=#@#WeatherComJSONMeasures3Day.inc

The next step is to edit all of the MeasureName= references in the meters; Lampo's weather only has 3 meters.
Here are the edited meters:

Code: Select all

[MeterCurrentIcon]
Meter=Image
MeasureName=@CurrentIcon
ImagePath=#@#Weather Icons
X=(160*#Scale#)
Y=(0*#Scale#)
W=(80*#Scale#)
ImageTint=#Color1#

[MeterWeatherInfo]
Meter=String
MeasureName=@CurrentConditions
MeasureName2=@CurrentTemperature
MeasureName3=@UnitsTemperature
StringAlign=Center
StringCase=Lower
FontFace=Roboto Light
FontColor=#Color1#
FontSize=(10*#Scale#)
X=(200*#Scale#)
Y=(80*#Scale#)
Text="#Today's weather is# %1 #with temperature of# %2°%3."
AntiAlias=1

[MeterHumAndWindInfo]
Meter=String
MeasureName=@CurrentHumidity
MeasureName2=@CurrentWindSpeed
MeasureName3=@UnitsSpeed
StringAlign=Center
StringCase=Lower
FontFace=Roboto Light
FontColor=#Color1#,150
FontSize=(10*#Scale#)
X=(0*#Scale#)r
Y=(0*#Scale#)R
Text="#Humidity is# %1 % #and wind speed is# %2 %3."
AntiAlias=1
You will see that all the MeasureName values have been replaced with the new names. The new measure names describe the data they return, so it is fairly easy to find the new MeasureName value by comparing them to the existing ones in your code.
For this skin, I also added StringCase=Lower so the sentence text displays properly.
Save the file.
Load or refresh the Lampo\Weather Info skin.

Where did all those new MeasureName values come from?
You can see those names by opening 'About' from the notification icon or 'Open log' from the 'Manage' dialog. Under the 'Skins' tab, select the 'Lampo\Weather Info' in the left column to see all of the available measure names and variables in the right column.
lampo1.png
To setup converted skins to show your weather, you need to manually edit Skins\Lampo\@Resources\WeatherComJSONVariables.inc.
Change the Latitude and Longitude values to your current location; you can use https://www.mapcoordinates.net to find those numbers.

To display the proper labels for temperature, distance, and speed set the Units value as described in that file.

Save that file and refresh the skin. With those 3 values set, you should see your weather in the skin.
You do not have the required permissions to view the files attached to this post.