DanielPodo wrote: ↑March 10th, 2020, 3:14 pm
Hi guys, it's been a while since I've paid a visit to these forums, as I haven't had much time to dabble with Rainmeter what with life etc.
My skin's location skin has stopped giving me...well...a location. It used to work, but for a while it's just been showing nothing, no idea why.
Here's the skin code:
[...]
FYI City is not showing up, so that's expected, but I should still get the country showing up (Poland, where I'm currently based).
Any help would be greatly appreciated!!!
Well, if you replace your code with this (make a backup first):
Code: Select all
[Variables]
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
---Measures---
[measureLocationParent]
Measure=WebParser
URL=https://mylocation.org/
UpdateRate=1800
;RegExp=(?siU)<td>Country</td><td>(.*)</td>.*<td>City</td><td>(.*)</td>
RegExp=(?siU)^(.*)$
;ErrorString="There is an error!"
[measureLocationCountry]
Measure=WebParser
URL=[measureLocationParent]
StringIndex=1
Substitute="":"..."
[measureLocationCity]
Measure=WebParser
URL=[measureLocationParent]
StringIndex=2
Substitute="":"..."
---Meters---
[MeterAutoLocateDemo]
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
MeasureName=measureLocationCity
MeasureName2=measureLocationCountry
Text=%1#CRLF#%2
;DynamicVariables=1
you'll see why. Apparently the site returns a "403 Forbidden" error. By the way, the site isn't too precise either: it's off with a couple of dozen kms in my case, so you may want to switch to a different one, like:
Code: Select all
[Variables]
Language=en-GB
URLCurrent=""
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
---Measures---
[MeasureLocationGeocode]
Measure=WebParser
URL=https://ipapi.co/json
RegExp="(?siU).*"city": (.*),.*"country_name": (.*),.*"
UpdateRate=600
FinishAction=[!UpdateMeasureGroup GeocodeGroup]
DynamicVariables=1
[MeasureCity]
Group=GeocodeGroup
Measure=WebParser
URL=[MeasureLocationGeocode]
StringIndex=1
UpdateDivider=-1
[MeasureCountry]
Group=GeocodeGroup
Measure=WebParser
URL=[MeasureLocationGeocode]
StringIndex=2
UpdateDivider=-1
---Meters---
[MeterAutoLocateDemo]
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
MeasureName=MeasureCity
MeasureName2=MeasureCountry
Text="City = %1#CRLF#Country = %2"
DynamicVariables=1
That's about it. If anyone has another solution for it (maybe changing the WebParser UserAgent or Header could help?), feel free to post it.