Please check the https://www.iplocationtools.com/ URL in your browser. Does it open this URL?
It is currently May 6th, 2024, 1:10 am
Generate Automatic WeatherCode from IP address in use
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Generate Automatic WeatherCode from IP address in use
-
- Posts: 442
- Joined: July 30th, 2014, 10:30 am
Re: Generate Automatic WeatherCode from IP address in use
yes, all the fields are filled out, apart from the Mobile Brand related...balala wrote: ↑October 4th, 2019, 7:31 pm Please check the https://www.iplocationtools.com/ URL in your browser. Does it open this URL?
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Generate Automatic WeatherCode from IP address in use
In this case I don't know. Maybe try restarting Rainmeter, then check the skin again, but I suppose this won't help.Pul53dr1v3r wrote: ↑October 4th, 2019, 7:37 pm yes, all the fields are filled out, apart from the Mobile Brand related...
-
- Posts: 442
- Joined: July 30th, 2014, 10:30 am
Re: Generate Automatic WeatherCode from IP address in use
no any change whatever i' did
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Generate Automatic WeatherCode from IP address in use
All I get is a regular expression error in the log. The skin can't return anything, as it is all based on that first WebParser measure.
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Generate Automatic WeatherCode from IP address in use
I'm quite certain that the site for me is returning something slightly different than for you, based on our locations.
It's not important, it's just why I sorta prefer the approach of the original poster, who is going after two sites that both return a standard json/xml format that won't care who or where you are. When possible, it's why I prefer a "feed" to "screen scraping".
It's not important, it's just why I sorta prefer the approach of the original poster, who is going after two sites that both return a standard json/xml format that won't care who or where you are. When possible, it's why I prefer a "feed" to "screen scraping".
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Generate Automatic WeatherCode from IP address in use
Yeah, probably a better approach.jsmorley wrote: ↑October 4th, 2019, 8:09 pm It's not important, it's just why I sorta prefer the approach of the original poster, who is going after two sites that both return a standard json/xml format that won't care who or where you are. When possible, it's why I prefer a "feed" to "screen scraping".
Can you reply to my last question here: https://forum.rainmeter.net/viewtopic.php?f=5&t=33606#p166268, please?
-
- Posts: 442
- Joined: July 30th, 2014, 10:30 am
Re: Generate Automatic WeatherCode from IP address in use
I found where's the problem.
RegExp=(?siU)<span class="flag-icon flag-icon-ro tooltips" data-placement="top" title="\[.*] .*"></span>(.*)</td>.*<div><label><strong>Coordinates of City</strong></label></div>.*<i class="fa fa-map-marker"></i> .*°.*".* .*°.*".*<br>\((.*), (.*)\).*<div><label><strong>Local Time</strong></label></div>.*\(UTC (.*)\).*<div><label><strong>Weather Station</strong></label></div>.*(.*) \((.*)\)
So if we set our country initials istead of your ro it should work.
RegExp=(?siU)<span class="flag-icon flag-icon-ro tooltips" data-placement="top" title="\[.*] .*"></span>(.*)</td>.*<div><label><strong>Coordinates of City</strong></label></div>.*<i class="fa fa-map-marker"></i> .*°.*".* .*°.*".*<br>\((.*), (.*)\).*<div><label><strong>Local Time</strong></label></div>.*\(UTC (.*)\).*<div><label><strong>Weather Station</strong></label></div>.*(.*) \((.*)\)
So if we set our country initials istead of your ro it should work.
-
- Rainmeter Sage
- Posts: 16200
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Generate Automatic WeatherCode from IP address in use
Yep, right! Sorry for my mistake. Now what about the modified code?Pul53dr1v3r wrote: ↑October 4th, 2019, 8:27 pm So if we set our country initials istead of your ro it should work.
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
[MeasureIPinfo]
Measure=WebParser
UpdateRate=3600
Url=https://www.iplocationtools.com/
RegExp=(?siU)<span class=".*" data-placement="top" title="\[.*] .*"></span>(.*)</td>.*<div><label><strong>Coordinates of City</strong></label></div>.*<i class="fa fa-map-marker"></i> .*°.*".* .*°.*".*<br>\((.*), (.*)\).*<div><label><strong>Local Time</strong></label></div>.*\(UTC (.*)\).*<div><label><strong>Weather Station</strong></label></div>.*(.*) \((.*)\)
[MeasureIPCountry]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=1
RegExpSubstitute=1
Substitute=" ":"","\n":"","^\s*(.*)$":"\1","\\1":""
Group=Location
[MeasureIPCity]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=5
RegExpSubstitute=1
Substitute=" ":"","\n":""
Group=Location
[MeasureIPLatitude]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=2
Group=Location
[MeasureIPLongitude]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=3
Group=Location
[MeasureIPWeatherCode]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=6
Group=Location
[MeasureIPTimeZone]
Measure=WebParser
Url=[MeasureIPinfo]
StringIndex=4
Group=Location
Substitute="+":""
Disabled=1
[MeterLocation]
Meter=STRING
MeasureName=MeasureIPCountry
MeasureName2=MeasureIPCity
MeasureName3=MeasureIPLatitude
MeasureName4=MeasureIPLongitude
MeasureName5=MeasureIPWeatherCode
MeasureName6=MeasureIPTimeZone
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Country: %1#CRLF#City: %2#CRLF#Latitude: %3#CRLF#Longitude: %4#CRLF#Weather code: %5#CRLF#Time zone: %6