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

two questions

Get help with creating, editing & fixing problems with skins
vijayFH
Posts: 79
Joined: April 18th, 2009, 9:50 am
Location: Germany

two questions

Post by vijayFH »

Hello everybody,

i have two questions:

First question:
What is the difference between this two codes?

Code:1

Code: Select all

[MeasureWeather]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=1800
Url=#URL2#
RegExp="(?siU)<weather ver="(.*)">(.*)<dnam>(.*)</dnam>(.*)<sunr>(.*)</sunr>(.*)<suns>(.*)</suns>(.*)<lsup>(.*)</lsup>(.*)<tmp>(.*)</tmp>(.*)<flik>(.*)</flik>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<r>(.*)</r>(.*)<d>(.*)</d>(.*)<s>(.*)</s>(.*)<gust>(.*)</gust>(.*)<d>(.*)</d>(.*)<t>(.*)</t>(.*)<hmid>(.*)</hmid>(.*)<i>(.*)</i>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="1" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="2" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="3" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)"
StringIndex=1
Code: 2

Code: Select all

[MeasureWeatherRSS]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=900
Url=http://xoap.weather.com/weather/local/#Zip#?cc=*&unit=#Unit#&dayf=4
RegExp="(?siU)<weather ver="(.*)">(.*)<dnam>(.*)</dnam>(.*)<sunr>(.*)</sunr>(.*)<suns>(.*)</suns>(.*)<zone>(.*)</zone>(.*)<tmp>(.*)</tmp>(.*)<t>(.*)</t>(.*)<icon>(.*)</icon>(.*)<icon>(.*)</icon>(.*)<t>(.*)</t>(.*)<day d="0" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)"(.*)<day d="1" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)(.*)<day d="2" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)(.*)<day d="3" t="(.*)" dt="(.*)">(.*)<hi>(.*)</hi>(.*)<low>(.*)</low>(.*)<icon>(.*)</icon>(.*)"
StringIndex=3
Second question:
Is it possible from code2, the data conform to code 1, because I think in code 2 missing some data. It may be?
How can it be both codes put together so con code 1 the data will not be lost, but by the code 2 the weather icon can be used!


BTW: I must apologize, I thought Rainmeter 3.2 would not be good, but slowly I realize it's damn good, I had at the beginning Difficulty with it, but slowly I realize it's really good. Thank you to the person you who has made this program.l. Thank you very much good work!

Thanks in advance for your help :thumbup:

vijay
PS: How can i put the Rainmeter in my Taskbar, i use Windows 8.1 I have try it but pic fo Rainmeter in the Taskbar strange^^
Der Computer ist die logische Weiterentwicklung
des Menschen: Intelligenz ohne Moral.
vijayFH
Posts: 79
Joined: April 18th, 2009, 9:50 am
Location: Germany

Re: two questions

Post by vijayFH »

Come on people, no one out there to explain me what is the different in this two codes?

i want to try to understand this, what chracter is for what, couse i have problem with the weather data and weather icons, i would like to slove this problem, but need your help please.

vijay
Der Computer ist die logische Weiterentwicklung
des Menschen: Intelligenz ohne Moral.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: two questions

Post by balala »

According to RainRegExp (such a great tool!) and using both codes with the same url, the first RegExp will give you these results:

Code: Select all

01=> 2.0
02=> 
        <head>
      <locale>en_US</locale>
      <form>MEDIUM</form>
      <ut>C</ut>
      <ud>km</ud>
      <us>km/h</us>
      <up>mb</up>
      <ur>mm</ur>
    </head>
        <loc id="GMXX0040">
      
03=> Frankfurt am Main, DT, Germany
04=> 
      <tm>3:30 PM</tm>
      <lat>50.11</lat>
      <lon>8.68</lon>
      
05=> 7:06 AM
06=> 
      
07=> 6:10 PM
08=> 
      <zone>1</zone>
    </loc>
        
        <swa>
        <a id="799351" uc="3">
        <t>Potential disruption due to wind until Tue Mar 03 2015 09:00 PM</t>
        <l>http://www.weather.com/weather/alerts/localalerts/GMXX0040?phenomena=TWA&significance=T3&areaid=DE004&office=XTWC&etn=DE004:TWA:T3:2015:03:03</l>
      </a>
      </swa>
        <cc>
        
09=> 3/03/15 3:25 PM CET
10=> 
        <obst>Offenbach, DT, GM</obst>
        
11=> 10
12=> 
        
13=> 10
14=> 
        
15=> Partly Cloudy / Windy
16=> 
        
17=> 30
18=> 
        
        <bar>
          
19=> 1017.95
20=> 
          
21=> steady
22=> 
        </bar>
        <wind>
      
23=> 35
24=> 
      
25=> N/A
26=> 
      
27=> 220
28=> 
      
29=> SW
30=> 
    </wind>
        
31=> 48
32=> 
        <vis>9.7</vis>
        <uv>
          
33=> 1
34=> 
          
35=> Low
36=> 
        </uv>
        <dewp>0</dewp>
        <moon>
          
37=> 12
38=> 
          
39=> Waxing Gibbous
40=> 
        </moon>
      </cc>
        <dayf>
        <lsup>3/03/15 7:00 AM CET</lsup>
        <day d="0" t="Tuesday" dt="Mar 3">
        <hi>10</hi>
        <low>0</low>
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p="d">
          <icon></icon>
          <t></t>
          <wind>
      <s>calm</s>
      <gust>N/A</gust>
      <d>0</d>
      <t>CALM</t>
    </wind>
          <bt></bt>
          <ppcp>0</ppcp>
          <hmid>52</hmid>
        </part>
        <part p="n">
          <icon>12</icon>
          <t>Rain Early</t>
          <wind>
      <s>22</s>
      <gust>N/A</gust>
      <d>255</d>
      <t>WSW</t>
    </wind>
          <bt>Rain Early</bt>
          <ppcp>90</ppcp>
          <hmid>84</hmid>
        </part>
      </day>
41=> Wednesday
42=> Mar 4
43=> 
        
44=> 8
45=> 
        
46=> 1
47=> 
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p="d">
          
48=> 30
49=> 
          
50=> Partly Cloudy
51=> 
          <wind>
      <s>19</s>
      <gust>N/A</gust>
      <d>255</d>
      <t>WSW</t>
    </wind>
          <bt>P Cloudy</bt>
          <ppcp>20</ppcp>
          <hmid>68</hmid>
        </part>
        <part p="n">
          <icon>29</icon>
          <t>Partly Cloudy</t>
          <wind>
      <s>14</s>
      <gust>N/A</gust>
      <d>300</d>
      <t>WNW</t>
    </wind>
          <bt>P Cloudy</bt>
          <ppcp>10</ppcp>
          <hmid>79</hmid>
        </part>
      </day>
52=> Thursday
53=> Mar 5
54=> 
        
55=> 7
56=> 
        
57=> -1
58=> 
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p="d">
          
59=> 30
60=> 
          
61=> Partly Cloudy
62=> 
          <wind>
      <s>22</s>
      <gust>N/A</gust>
      <d>358</d>
      <t>N</t>
    </wind>
          <bt>P Cloudy</bt>
          <ppcp>10</ppcp>
          <hmid>65</hmid>
        </part>
        <part p="n">
          <icon>31</icon>
          <t>Clear</t>
          <wind>
      <s>8</s>
      <gust>N/A</gust>
      <d>8</d>
      <t>N</t>
    </wind>
          <bt>Clear</bt>
          <ppcp>10</ppcp>
          <hmid>85</hmid>
        </part>
      </day>
63=> Friday
64=> Mar 6
65=> 
        
66=> 9
67=> 
        
68=> 0
69=> 
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p="d">
          
70=> 34
71=> 
          
72=> Mostly Sunny
73=>
The second:

Code: Select all

01=> 2.0
02=> 
        <head>
      <locale>en_US</locale>
      <form>MEDIUM</form>
      <ut>C</ut>
      <ud>km</ud>
      <us>km/h</us>
      <up>mb</up>
      <ur>mm</ur>
    </head>
        <loc id="GMXX0040">
      
03=> Frankfurt am Main, DT, Germany
04=> 
      <tm>3:30 PM</tm>
      <lat>50.11</lat>
      <lon>8.68</lon>
      
05=> 7:06 AM
06=> 
      
07=> 6:10 PM
08=> 
      
09=> 1
10=> 
    </loc>
        
        <swa>
        <a id="799351" uc="3">
        <t>Potential disruption due to wind until Tue Mar 03 2015 09:00 PM</t>
        <l>http://www.weather.com/weather/alerts/localalerts/GMXX0040?phenomena=TWA&significance=T3&areaid=DE004&office=XTWC&etn=DE004:TWA:T3:2015:03:03</l>
      </a>
      </swa>
        <cc>
        <lsup>3/03/15 3:25 PM CET</lsup>
        <obst>Offenbach, DT, GM</obst>
        
11=> 10
12=> 
        <flik>10</flik>
        
13=> Partly Cloudy / Windy
14=> 
        
15=> 30
16=> 
        
        <bar>
          <r>1017.95</r>
          <d>steady</d>
        </bar>
        <wind>
      <s>35</s>
      <gust>N/A</gust>
      <d>220</d>
      <t>SW</t>
    </wind>
        <hmid>48</hmid>
        <vis>9.7</vis>
        <uv>
          <i>1</i>
          <t>Low</t>
        </uv>
        <dewp>0</dewp>
        <moon>
          
17=> 12
18=> 
          
19=> Waxing Gibbous
20=> 
        </moon>
      </cc>
        <dayf>
        <lsup>3/03/15 7:00 AM CET</lsup>
        
21=> Tuesday
22=> Mar 3
23=> 
        
24=> 10
25=> 
        
26=> 0
27=> 
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p=
28=> d">
          <icon></icon>
          <t></t>
          <wind>
      <s>calm</s>
      <gust>N/A</gust>
      <d>0</d>
      <t>CALM</t>
    </wind>
          <bt></bt>
          <ppcp>0</ppcp>
          <hmid>52</hmid>
        </part>
        <part p="n">
          <icon>12</icon>
          <t>Rain Early</t>
          <wind>
      <s>22</s>
      <gust>N/A</gust>
      <d>255</d>
      <t>WSW</t>
    </wind>
          <bt>Rain Early</bt>
          <ppcp>90</ppcp>
          <hmid>84</hmid>
        </part>
      </day>
29=> Wednesday
30=> Mar 4
31=> 
        
32=> 8
33=> 
        
34=> 1
35=> 
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p="d">
          
36=> 30
37=> 
38=> 
          <t>Partly Cloudy</t>
          <wind>
      <s>19</s>
      <gust>N/A</gust>
      <d>255</d>
      <t>WSW</t>
    </wind>
          <bt>P Cloudy</bt>
          <ppcp>20</ppcp>
          <hmid>68</hmid>
        </part>
        <part p="n">
          <icon>29</icon>
          <t>Partly Cloudy</t>
          <wind>
      <s>14</s>
      <gust>N/A</gust>
      <d>300</d>
      <t>WNW</t>
    </wind>
          <bt>P Cloudy</bt>
          <ppcp>10</ppcp>
          <hmid>79</hmid>
        </part>
      </day>
39=> Thursday
40=> Mar 5
41=> 
        
42=> 7
43=> 
        
44=> -1
45=> 
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p="d">
          
46=> 30
47=> 
48=> 
          <t>Partly Cloudy</t>
          <wind>
      <s>22</s>
      <gust>N/A</gust>
      <d>358</d>
      <t>N</t>
    </wind>
          <bt>P Cloudy</bt>
          <ppcp>10</ppcp>
          <hmid>65</hmid>
        </part>
        <part p="n">
          <icon>31</icon>
          <t>Clear</t>
          <wind>
      <s>8</s>
      <gust>N/A</gust>
      <d>8</d>
      <t>N</t>
    </wind>
          <bt>Clear</bt>
          <ppcp>10</ppcp>
          <hmid>85</hmid>
        </part>
      </day>
49=> Friday
50=> Mar 6
51=> 
        
52=> 9
53=> 
        
54=> 0
55=> 
        <sunr>7:06 AM</sunr>
        <suns>6:10 PM</suns>
        
        <part p="d">
          
56=> 34
57=> 
See that the first RegExp returns 73 strings, while the second just 57. But the returned values must be improved.
vijayFH
Posts: 79
Joined: April 18th, 2009, 9:50 am
Location: Germany

Re: two questions

Post by vijayFH »

hello balala,

imagine you have not the programm "RainRegExp" how will you creat the RegExp for the weather.

I'm just confused as to what means for example (. *) <t> (. *) </ t> (. *) or
<Tmp> (. *) </ Tmp> (. *) How do I know which letter for what is, and what character (. *) Or (. *)

thats realy confused, because there are only letter and characters no name forexample, temperature, windspeed, feelike.....

vijay
Der Computer ist die logische Weiterentwicklung
des Menschen: Intelligenz ohne Moral.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: two questions

Post by balala »

vijayFH wrote:imagine you have not the programm "RainRegExp" how will you creat the RegExp for the weather.
When I first used the WebParser plugin I had no RainRegExp. That work was hard. It not worth. It's simplest using that great tool.
vijayFH wrote:I'm just confused as to what means for example (. *) <t> (. *) </ t> (. *) or
<Tmp> (. *) </ Tmp> (. *) How do I know which letter for what is, and what character (. *) Or (. *)

thats realy confused, because there are only letter and characters no name forexample, temperature, windspeed, feelike.....

vijay
Well, I'm not programmer and I'm sure my explanations won't be the best and someone will come up with a better, but eg the <Tmp>(.*)</Tmp> (without spaces!!!) expression means that in the html code of the parsed page somewhere you have something like <Tmp>3</Tmp>. The <Tmp> and </Tmp> tags define the temperature value. So, parsing the above line (<Tmp>3</Tmp>) will return you the temperature: 3 (default unit, probably degrees). In the RegExp the <Tmp>(.*)</Tmp> is the code which returns, this case, 3, instead of (.*) (take a look at this).
vijayFH
Posts: 79
Joined: April 18th, 2009, 9:50 am
Location: Germany

Re: two questions

Post by vijayFH »

hi balala,

Thank you very much for the nice explanation :thumbup:


vijay
Der Computer ist die logische Weiterentwicklung
des Menschen: Intelligenz ohne Moral.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: two questions

Post by balala »

You're welcome and I hope you understood what I wanted to say.