It is currently May 6th, 2024, 7:47 pm

[Solved] Weather Parsing ErrorCode=12006

Get help with creating, editing & fixing problems with skins
User avatar
qwertyoctopus
Posts: 17
Joined: November 26th, 2010, 4:49 am

[Solved] Weather Parsing ErrorCode=12006

Post by qwertyoctopus »

I'm new to Rainmeter and I decided to take on a rather ambitious task. I want to set up my very own desktop, from scratch, within the next month; basically, I want to be finished by Christmas. I got the Digital clock set up, with a small hiccup with setting the right font up, and now I'm moving on to Weather. This is my Skin so far,

Code: Select all

[MeasureWeatherDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url="xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7"
RegExp="(?siU)<day d="0" t=""(.*)".*"
StringIndex=1
Debug=1

[MeterString]
Meter=String
X=2
Y=17r
FontColor=0,0,0,255
FontSize=12
StringAlign=LEFT
FontFace=Tahoma
Antialias=1
Prefix="Day Today: "
And this is the Debug Module:

Code: Select all

DEBUG: (10:14:03.068) Reading file: C:\Users\Michael\AppData\Roaming\Rainmeter\Rainmeter.ini
DEBUG: (10:14:03.177) ConfigEditor: "C:\Windows\system32\NOTEPAD.EXE"
DEBUG: (10:14:03.177) LogViewer: "C:\Windows\system32\NOTEPAD.EXE"
DEBUG: (10:14:03.192) Refreshing skin "Vortex\Time\Time.ini"
DEBUG: (10:14:03.192) Reading file: C:\Users\Michael\AppData\Roaming\Rainmeter\Rainmeter.ini
DEBUG: (10:14:03.302) Reading file: C:\Users\Michael\Documents\Rainmeter\Skins\Vortex\Time\Time.ini
DEBUG: (10:14:03.302) Refreshing skin "Vortex\Weather\Weather.ini"
DEBUG: (10:14:03.317) Reading file: C:\Users\Michael\AppData\Roaming\Rainmeter\Rainmeter.ini
DEBUG: (10:14:03.411) Reading file: C:\Users\Michael\Documents\Rainmeter\Skins\Vortex\Weather\Weather.ini
DEBUG: (10:14:03.426) WebParser: Fetching URL: xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7
DEBUG: (10:14:03.426) WebParser (1640) Unknown error (ErrorCode=12006)
Does error code 12006 refer to Microsoft's "This Web Page is not Supported" Error Code? And don't other weather skins use xml. web pages? Any help would really be appreciated.

Thanks,
Michael
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Parsing ErrorCode=12006

Post by jsmorley »

Try it with URL=http://xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7

instead of just URL=xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7

And see if that helps. WebParser likes to know what protocol you want to use. ;-)

Also, your RegExp is failing. You have one too many quotes.

RegExp="(?siU)<day d="0" t=""(.*)".*"

This will work:

RegExp="(?siU)<day d="0" t="(.*)".*"

As you move forward adding to your RegExp to collect more information from the feed, you may find this tool of some value:

http://rainmeter.net/forum/viewtopic.php?f=18&t=769&hilit=RainRegExp
User avatar
qwertyoctopus
Posts: 17
Joined: November 26th, 2010, 4:49 am

Re: Weather Parsing ErrorCode=12006

Post by qwertyoctopus »

Thank you so much! I noticed the RegExp error after I posted my question but I didn't think to add http://. Thanks! Now the debug file is showing what it is supposed to(Thursday), but it isn't displaying on the string meter. Do you(or anybody else) know what is causing this?

Thanks,
Michael
User avatar
qwertyoctopus
Posts: 17
Joined: November 26th, 2010, 4:49 am

Re: Weather Parsing ErrorCode=12006

Post by qwertyoctopus »

This is my new Skin.ini just so anyone reading this is updated.

Code: Select all

[MeasureWeatherDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=http://xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7
RegExp="(?siU)<day d="0" t="(.*)".*"
StringIndex=1
Debug=1

[MeterString]
Meter=String
MeasureName=MeasureWeatherDay1
X=2
Y=17
FontColor=0,0,0,255
FontSize=12
StringAlign=LEFT
FontFace=Tahoma
Antialias=1
Prefix="Day Today: "
Text=%1
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Parsing ErrorCode=12006

Post by jsmorley »

It works fine for me. Try restarting Rainmeter

I can't see the rest of your code, so what MAY be happening for you is that you have two meters with the name [name], which is not allowed and will cause only one of them to be displayed. I'm suspicious of this due to the name [MeterString] you gave the meter displaying today's weekday. You should use [MeterTodayName] or something both more descriptive, (for debugging purposes) and unique.

If this is not the case, another thing that may have happened is WebParser got hung up. This CAN happen when you are debugging a skin and hitting refresh over and over. it may take anywhere from a few milliseconds to several seconds for WebParser to fully retrieve a web site, and if you fire it over and over before it can finish each run, it can get hung up. Restarting Rainmeter will fix this if it happens.

By the way, the next problem you are going to hit I can see coming...

The way WebParser works, you retrieve the entire web page and parse out just the information you desire in the main WebParser measure, the one with the RegExp= on it. You then pick out the bits of information you want, the ones you returned in "(.*)" by using StringIndex=xxx. The xxx is which, in order, of the "(.*)" returns you want to use / display. Since StringIndex= is set in a measure, not a meter, you are going to need multiple WebParser measures to get more than one value.

Let me illustrate:

Code: Select all

[MeasureWeatherDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=http://xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7
RegExp="(?siU)<day d="0" t="(.*)".*"
StringIndex=1
What you have now, returns just one value, and using StringIndex=1 on the measure returns that value.

Code: Select all

[MeasureWeatherDay1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=http://xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7
RegExp="(?siU)<day d="0" t="(.*)".*dt="(.*)".*"
StringIndex=1
Logical extension of the RegExp, to get the next bit of data you may want, the "date". Problem is, StringIndex 1 is still going to return "Friday" and there is no way to get at the value returned in t="(.*)".

So what we do is use the main WebParser measure to return ALL values we want, then individual measures to put each value in its own StringIndex.

Code: Select all

[MeasureWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=http://xml.weather.com/weather/local/53221?&unit=Farenheit&dayf=7
RegExp="(?siU)<day d="0" t="(.*)".*dt="(.*)".*"

[MeasureTodayName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=[MeasureWeather]
StringIndex=1

[MeasureTodayDate]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
URL=[MeasureWeather]
StringIndex=2

[MeterTodayName]
Meter=String
MeasureName=MeasureTodayName
X=2
Y=17
FontColor=0,0,0,255
FontSize=12
StringAlign=LEFT
FontFace=Tahoma
Antialias=1
Prefix="Day Today: "
Text=%1

[MeterTodayDate]
Meter=String
MeasureName=MeasureTodayDate
X=2
Y=4R
FontColor=0,0,0,255
FontSize=12
StringAlign=LEFT
FontFace=Tahoma
Antialias=1
Prefix="Date Today: "
Text=%1
Take a look at what I did, and you will see the "approach" needed. Let me know if you have questions about why / how, but you will also find this http://rainmeter.net/cms/Tips-WebParserPrimer to be helpful in wrangling WebParser.
User avatar
qwertyoctopus
Posts: 17
Joined: November 26th, 2010, 4:49 am

Re: Weather Parsing ErrorCode=12006

Post by qwertyoctopus »

*Facepalm*

Here I was messing with all these different settings and random bits of code, when the problem was that I didn't set the Width long enough for the returned string to be seen. Thanks for all the help, it was very useful, and also that program that you linked me too will be oh so useful later today and tomorrow while I'm working on all these weather configs.

Thanks again,
Michael
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Parsing ErrorCode=12006

Post by jsmorley »

Glad to help. Have fun!