weather plugin question or maybe a suggestion
Started by riow


Rate this topic
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5


5 posts in this topic
riow
Junior Member
**


0
4 posts 2 threads Joined: Dec 2003
12-13-2003, 07:49 AM -
#1
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
Senior Member
****


0
658 posts 24 threads Joined: Sep 2002
12-13-2003, 09:36 AM -
#2
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
Junior Member
**


0
4 posts 2 threads Joined: Dec 2003
12-15-2003, 07:44 PM -
#3
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
Senior Member
****


0
658 posts 24 threads Joined: Sep 2002
12-15-2003, 08:23 PM -
#4
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
Junior Member
**


0
4 posts 2 threads Joined: Dec 2003
12-15-2003, 08:41 PM -
#5
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.


Forum Jump:


Users browsing this thread: 1 Guest(s)