It is currently March 28th, 2024, 11:41 pm

Weather Skins Not Working

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

jsmorley wrote: July 29th, 2020, 9:18 pm I don't think we can depend on DecodeCharacterReference for this, as that is designed to decode HTML characters references like &#nnnn;, &#xhhhh;, or &name;. This is an unfortunate situation, as I think the only current alternative is some kind of massive lookup / substitution on all these possible characters, which a bunch.
Yep. I'm just working on a skin to automate building that substitute. So far one replacement is done (through converting decimal to hexa), now I'm on the iteration part (this would probably iterate from 0 to 65535^2 or whatever the FFFF is). It will work, that I can guarantee. It remains to be seen if I can finish it tonight and how it will fare on resources (since it uses self updating measures). ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

Yincognito wrote: July 29th, 2020, 9:24 pm Yep. I'm just working on a skin to automate building that substitute. So far one replacement is done (through converting decimal to hexa), now I'm on the iteration part (this would probably iterate from 0 to 65535^2 or whatever the FFFF is). It will work, that I can guarantee. It remains to be seen if I can finish it tonight and how it will fare on resources (since it uses self updating measures). ;-)
Can you post the API key and URL format that you are using to get the native JSON output? I gather there is a key embedded in the site somewhere, so I suspect it's not a huge "coke formula" secret.

I can't see how any Substitute that iterates through all 1,080,212 characters in the site data 65,536 times can possibly be anything but a resource issue.
DrRoboculous
Posts: 8
Joined: June 7th, 2020, 7:18 pm

Re: Weather Skins Not Working - This is the only allowed thread about this

Post by DrRoboculous »

Hey all. So, i tried the 2 steps thing mentioned on a previous post and it didn't work for me but, i have no idea what i'm doing. I've posted on this board before about how i'm just a rainmeter user, not a skinner or coder or anything. Let me try to lay out exactly what i was doing:
I'm currently using the ASTROWeather skin by xxenium. I use Notepad++ to edit the files. I opened C:\Users\[username]\OneDrive\Documents\Rainmeter\Skins\ASTROWeather\@Resources\Measures.inc and used the Search & Replace function in Notepad++ to replace all instances of " with //" . Then i opened C:\Users\[username]\OneDrive\Documents\Rainmeter\Skins\ASTROWeather\@Resources\Variables.inc and added ,"\\":"" to the end of where that file says URL=https://weather.com/#Language#/weather/today/l/#LocationCode#, right after the #LocationCode# part. Then i tried adding it to after my actual location code. Then i tried adding it to right after both the #Language# and the #LocationCode# part. I never found anything anywhere that said #CommonSubstitute# and the "LocationCode" & "Language" parts were the only parts that had that #[x]# format in the file. So . . . any help?
Some of us need a Fisher-Price: My First Coding Experience section on the forum to explain stuff to us dummies.
Thanks, all. :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

jsmorley wrote: July 29th, 2020, 9:26 pm Can you post the API key and URL format that you are using to get the native JSON output? I gather there is a key embedded in the site somewhere, so I suspect it's not a huge "coke formula" secret.
Yes. I'll do even better - post these and post the skin which automatically builds substitutes. :D

The URL I use to access and test the API JSON (the API Key in it is embedded in the source page - which is used for everyone's access when loading the site in the browser - so it's technically legit):

Code: Select all

https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-wx-forecast-daily-15day;v3-location-point?geocode=<latitude>,<longitude>&format=json&units=m&language=en-CA&apiKey=d522aa97197fd864d36b418f39ebb323
The skin that automatically builds substitutes (only from 537 to 540 here, but can be adjusted):

Code: Select all

[Variables]
Number=537
NumberMax=540
Quotient=(#Number#)
Result=""
Substitute=""
Base=16
Iteration=0

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[MeasureConvert]
Group=SubstituteGroup
Measure=Calc
Formula=(#Quotient#%#Base#)
UpdateDivider=-1
RegExpSubstitute=1
Substitute="^10$":"A","^11$":"B","^12$":"C","^13$":"D","^14$":"E","^15$":"F","^16$":"G","^17$":"H","^18$":"I","^19$":"J","^20$":"K","^21$":"L","^22$":"M","^23$":"N","^24$":"O","^25$":"P","^26$":"Q","^27$":"R","^28$":"S","^29$":"T","^30$":"U","^31$":"V","^32$":"W","^33$":"X","^34$":"Y","^35$":"Z"
IfCondition=(#Iteration#<4)
IfTrueAction=[!SetVariable Result "[MeasureConvert]#Result#"][!SetVariable Quotient (Trunc(#Quotient#/#Base#))][!SetVariable Iteration (#Iteration#+1)][!UpdateMeasure "MeasureConvert"]
IfFalseAction=[!SetVariable Substitute """#Substitute#"\\u#Result#":"[\x#Result#]","""][!SetVariable Iteration 0][!SetVariable Number (#Number#+1)][!SetVariable Quotient (#Number#+1)][!SetVariable Result ""]
IfCondition2=(#Iteration#>=4) && (#Number#<#NumberMax#)
IfTrueAction2=[!UpdateMeasure "MeasureConvert"]
IfConditionMode=1
DynamicVariables=1

---Meter---

[MeterConvert]
Meter=STRING
X=5
Y=5
FontFace=Consolas
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
FontSize=16
AntiAlias=1
Text="Substitute = #Substitute#"
DynamicVariables=1
Preview:
Unicode Substitute.jpg
Enjoy. Now both possibilities are open, creating the needed substitute or using the alternate URL.
jsmorley wrote: July 29th, 2020, 9:26 pmI can't see how any Substitute that iterates through all 1,080,212 characters in the site data 65,536 times can possibly be anything but a resource issue.
No. I meant iterating from 0 to 65535^2 in order to build the substitute for all the numbers in the interval (converted to hexa).
You do not have the required permissions to view the files attached to this post.
Last edited by Yincognito on July 29th, 2020, 9:58 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working - This is the only allowed thread about this

Post by jsmorley »

DrRoboculous wrote: July 29th, 2020, 9:54 pm Hey all. So, i tried the 2 steps thing mentioned on a previous post and it didn't work for me but, i have no idea what i'm doing. I've posted on this board before about how i'm just a rainmeter user, not a skinner or coder or anything. Let me try to lay out exactly what i was doing:
I'm currently using the ASTROWeather skin by xxenium. I use Notepad++ to edit the files. I opened C:\Users\[username]\OneDrive\Documents\Rainmeter\Skins\ASTROWeather\@Resources\Measures.inc and used the Search & Replace function in Notepad++ to replace all instances of " with //" . Then i opened C:\Users\[username]\OneDrive\Documents\Rainmeter\Skins\ASTROWeather\@Resources\Variables.inc and added ,"\\":"" to the end of where that file says URL=https://weather.com/#Language#/weather/today/l/#LocationCode#, right after the #LocationCode# part. Then i tried adding it to after my actual location code. Then i tried adding it to right after both the #Language# and the #LocationCode# part. I never found anything anywhere that said #CommonSubstitute# and the "LocationCode" & "Language" parts were the only parts that had that #[x]# format in the file. So . . . any help?
Some of us need a Fisher-Price: My First Coding Experience section on the forum to explain stuff to us dummies.
Thanks, all. :thumbup:
Put everything back as it was. The way you are going is just not going to work. I would recommend waiting until xxenium updates his skin, after we sort out how best to approach this at a high-level.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

Yincognito wrote: July 29th, 2020, 9:55 pm Yes. I'll do even better - post these and post the skin which automatically builds substitutes. :D

The URL I use to access and test the API JSON (the API Key in it is embedded in the source page - which is used for everyone's access when loading the site in the browser - so it's technically legit):

Code: Select all

https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-wx-forecast-daily-15day;v3-location-point?geocode=<latitude>,<longitude>&format=json&units=m&language=en-CA&apiKey=d522aa97197fd864d36b418f39ebb323
What is the format for using a location code instead of lat/long?
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

jsmorley wrote: July 29th, 2020, 9:58 pm What is the format for using a location code instead of lat/long?
Hm... I don't know at the moment - I only used it with lat/long in my tests.

EDIT: Instead of a "location code", I believe it's possible to use the locId (the one present in the main page source as well), but that's even longer of course.

EDIT2: Try using the parameters here (i.e. locid, postalKey, etc.), see if it works:

Code: Select all

Location Service - Point
URL Construction
Search by Geocode : Required Parameters: geocode, language, format
Returns information for search string ="geoco".
Aggregate Product Name
https://api.weather.com/v3/location/point? geocode=33.74,-84.39 &language=en-US&format=json&apiKey= yourApiKey v3-location-point
Search by Location ID : Required Parameters: locid, language, format
Returns information for search locid = “USWY0183:1:US”.
Aggregate Product Name
https://api.weather.com/v3/location/point? locid=USWY0183:1:US &language=en-US&format=json&apiKey= yourApiKey v3-location-point
Search by Postal Key: Required Parameters: postalKey, language, format
Returns information for search string postalKey = “30339:US” Postal Key is a composite of <Postal Code>:<Country Code>
Aggregate Product Name
https://api.weather.com/v3/location/point? postalKey=30339:US &language=en-US&format=json&apiKey= yourApiKey v3-location-point
Search by IATA Code [location/point only] : Required Parameters: iataCode, language, format
Returns information for search string = “ATL”
Aggregate Product Name
https://api.weather.com/v3/location/point? iataCode=ATL &language=en-US&format=json&apiKey= yourApiKey v3-location-point
Search by ICAO Code [location/point only]: Required Parameters: icaoCode, language, format
Returns information for search string = “KATL”
Aggregate Product Name
https://api.weather.com/v3/location/point? icaoCode=KATL &language=en-US&format=json&apiKey= yourApiKey v3-location-point
Search by Place ID: Required Parameters: placeid, language, format
Returns information for search string = ee0214ae7fb1d265f3e4d2509e77557119b2cac9d0ac1013b593c74a1567f2b7
Aggregate Product Name
https://api.weather.com/v3/location/point? placeid=ee0214ae7fb1d265f3e4d2509e77557119b2cac9d0ac1013b593c74a1567f2b7 &language=en-US&format=json&apiKey= yourApiKey
Last edited by Yincognito on July 29th, 2020, 10:08 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Skins Not Working

Post by jsmorley »

Yincognito wrote: July 29th, 2020, 10:01 pm Hm... I don't know at the moment - I only used it with lat/long in my tests.

EDIT: Instead of a "location code", I believe it's possible to use the locId (the one present in the main page source as well), but that's even longer of course.
That's not going to work for me. I really wanted to be able to get at it with USVA0944 as an example.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

jsmorley wrote: July 29th, 2020, 10:06 pm That's not going to work for me. I really wanted to be able to get at it with USVA0944 as an example.
See the edit on my previous post.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: Weather Skins Not Working - This is the only allowed thread about this

Post by SilverAzide »

To get weather alerts, add "v3alertsHeadlines" into the URL, as in:

Code: Select all

https://api.weather.com/v3/aggcommon/v3-wx-observations-current;v3-wx-forecast-daily-15day;v3alertsHeadlines;v3-location-point?format=json&geocode=36.172,-115.13&units=e&language=en-US&apiKey=6532d6454b8aa370768e63d6ba5a832e
This is a Las Vegas query, currently (as of this minute) under a excessive heat warning.
Gadgets Wiki GitHub More Gadgets...