Tordex Community
weather plugin question or maybe a suggestion - Printable Version

+- Tordex Community (http://forum.tordex.com)
+-- Forum: True Launch Bar plugins (http://forum.tordex.com/forum-4.html)
+--- Forum: Plugin features and improvements (http://forum.tordex.com/forum-15.html)
+--- Thread: weather plugin question or maybe a suggestion (/thread-1059.html)



- riow - 12-13-2003

Hi, it seems that the weather icon is parsed at a fixed location of web page from each provider, isn't it? If so, I suggest that parsing for weather icon could be done using the method of find0, find1, delim which could all be customized by user. Thus user could parse their wanted new web page to get other newly created weather icons.


- shapeshifter - 12-13-2003

Quote:I suggest that parsing for weather icon could be done using the method of find0, find1, delim which could all be customized by user.

It is already done this way.

Code:
[options]
name = Yahoo Weather - 3 Day
starturl= http://weather.yahoo.com/
SendCookies = 0

[Conditions]
find0 = "<!--CURCON-->"
find1 = "<!-- teswt -->"
delim = "<"

The [Conditions] section of the provider file is responsible for parsing the text used to generate the conditions icon.


- riow - 12-15-2003

Thank you. I've missed the Condition section.

BTW, could you pls tell me how to add a delim to represent end of line?


- shapeshifter - 12-15-2003

Quote:BTW, could you pls tell me how to add a delim to represent end of line?

As far as I know, all whitespace (spaces, tabs, line feeds etc.) are ignored when parsing HTML, regardless of which program (web browser, weather monitor) is doing the parsing. There are lots of ways to force the display to begin on a new line, such as
, <hr>, enclosing the content in

tags, or creating layers. Fortunately, all of these methods will give you a non-whitespace character you can use as the delimiter. Unfortunately, you'll need to look at the code to determine which character is appopriate. In general, however, "<" works well, since that's what all HTML tags begin with.

If you are having problems, please post a link to the page you're parsing, and the text you wish to extract.


- riow - 12-15-2003

Thanks. I use the leading characters on the next line as delim, and it works now. Since the the web page is a plain text web page without html, your mentioned "<" is not appropriate for the case.