Weather Monitor parsing bug - Printable Version +- Tordex Community (http://forum.tordex.com) +-- Forum: True Launch Bar plugins (http://forum.tordex.com/forum-4.html) +--- Forum: Plugins bugs (http://forum.tordex.com/forum-17.html) +--- Thread: Weather Monitor parsing bug (/thread-1309.html) |
- HorusUK - 03-06-2004 In the following code fragment from a provider file I'm writing, I've found a potential problem with fetching temperatures. Code: ; Dewpoint Here's the HTML I'm parsing: Code: Dewpoint: 3 °C<br /> Parsing this returns 0°C, but if I remove the Unit = C line from the provider file, I get 3 returned. I've tried a delim = "°" just in case that was the cause, but I still get 0°C! - Yuri Kobets - 03-06-2004 Try to change find2 string: find2 = "Dewpoint: " Add space into string. - shapeshifter - 03-06-2004 I'm pretty sure Yuri's suggestion will fix this problem, but just in case, you can try adding a "ValueType = INT" to your ini section. I'm not holding my breath on that one becuase I suspect that assigning C or F as the unit has the same effect. I do know that if you try to assign a string variable (like a space or a letter) to an INTeger variable type (such as with unit type C), the plugin will return a 0 as the measurement. (I'm pretty sure you already knew this, HorusUK, just posting it here for the benefit of others.) I exploited this in my X-Mod Wind skin. The web page I'm parsing will sometimes report "N/A" for the wind gust speed, which would throw off my skin's alignment. By telling WM to expect an INT(eger), it interprets "N/A" as 0, which fits just fine in my skin. - HorusUK - 03-07-2004 Quote:...you can try adding a "ValueType = INT" to your ini section....Shapeshifter, you're right, I've pretty pretty much exhausted all combinations here! The trouble with using a valuetype=int is that I can't get accurate °F temperatures as they're in the format 43.2°F, so valuetype=INT only returns 43°F. I too use the valuetype = INT "trick" to return 0 for gusts in my wind skin! Quote:Try to change find2 string:Yuri, I changed my code to include spaces at the end of find2 = "Dewpoint " and beginning of "delim = " °" to eliminate ALL spaces: Code: ; Dewpoint Which brings me very nicely around to the point I made in this thread. - shapeshifter - 03-07-2004 Unless you specify a ValueType, the default is STRING. I think ignoring whitespace would cause problems. I frequently use a space as either a find parameter or a delimiter. Yuri: I was under the assumption (though I'm not sure why) that WM only used one character as the delimiter. Is it true that you can use multiple characters to deliminate? - HorusUK - 03-07-2004 shapeshifter Wrote:Unless you specify a ValueType, the default is STRING. I think ignoring whitespace would cause problems. I frequently use a space as either a find parameter or a delimiter.That's the problem, shapeshifter, we all have slightly different requirements. And I must admit, I use a space as a delimiter, on occasion. Boy, has Yuri got his work cut out on the Universal Data Fetcher - HorusUK - 03-26-2004 Whilst parsing a news web site, I noticed that TLB is filtering out apostrophes. I'm not sure if other punctuation is affected. i.e. I want to fetch Major Backs Blair's Libya Trip becomes Major Backs Blair s Libya Trip (notice the missing apostrophe in Blair s... |