WatzNewÖ
WatzNewÖ
Your Smart Web Site Monitoring AgentÖ A.I.Studio
Creative software development
Index | Owner's Manual | FAQ | Version History | Purchase | Web Site (online)
WatzNewÖ Documentation > Owner's Manual > Search patterns and message templates > Complex example of using search patterns

Complex example of using search patterns

# Adding more power

This example will show you the power of WatzNewÖ. Assume we have the following html page and want to track new releases of software called ABC Html Colorizer.

<BODY>

<H1>ABCSoft. Our software:</H1>

<H2>ABC E-mail Checker</H2>
<UL>
<LI>Latest release date: 01-Apr-1999
<LI><A href="abc_checker.zip">Download v.1.15 now!</A> - 433 KB ZIP archive
<LI><A href="abc_checker_help.zip">Help file in .HLP format</A> - 39 KB ZIP archive
</UL>

<H2>ABC Html Colorizer</H2>
<UL>
<LI>Latest release date: 03-Apr-1999
<LI><A href="abc_htmlcolor.zip">Download v.1.30 now!</A> - 172 KB ZIP archive
<LI><A href="abc_htmlcolor_help.zip">Help file in .HLP format</A> - 60 KB ZIP archive
</UL>

...

</BODY>

Our search pattern would be:

<H2>ABC Html Colorizer</H2>{*}Download v.{%}now!
This means:
  • find the first occurence of <H2>ABC Html Colorizer</H2> in the html document;
  • skip any number of characters until the Download v. substring is found;
  • treat any text between it and the following occurence of now! as the first parameter (that corresponds to %1 in message template).

and the message template would be:

Current version of ABC Html Colorizer is %1

If we apply the above rules to our html document we will get "Current version of ABC Html Colorizer is 1.30" message.

Adding more power

And what if we want to track not only the software version but the release date and ZIP file size?

Let's modify our search pattern:

<H2>ABC Html Colorizer</H2>{*}
Latest release date:{%}
Download v.{%}now! -{%}ZIP archive
This means:
  1. find the first occurence of <H2>ABC Html Colorizer</H2> in the html document;
  2. skip any number of characters until the Latest release date: substring is found;
  3. treat any text between it and the following occurence of Download v. as the first parameter (that corresponds to %1 in message template);
  4. treat any text between Download v. and the following occurence of now! - as the second parameter (%2 in message template). Note that all html tags are stripped from the found substring unless you enable the ' Preserve tags' option in channel's properties;
  5. treat any text between now! - and the following occurence of ZIP archive as the third parameter (%3 in message template).

Note: splitting the pattern into lines won't affect it's functionality. WatzNewÖ will ignore all line breaks.

So, we must eventually get the release date, version and file size in %1, %2 and %3 parameters respectively. Let's modify our message template:

Current version of ABC Html Colorizer is %2 (%3), released on %1

If we apply the above rules to our html document we will get "Current version of ABC Html Colorizer is 1.30 (172 KB), released on 03-Apr-1999" message.

See next

⌐á1998û2002áA.I.Studio. All rights reserved.
Contacts | Legal Information