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 > Search pattern and message template macros

Search pattern and message template macros

# Search pattern macros
# Message template macros and tags
# Date / Time macros
# Simple example

WatzNewÖ utilizes a simple to create yet powerful search pattern scheme to retrieve specific data from html pages. When the data is retrieved, WatzNewÖ takes the message template to form a user-friendly message.

Search pattern macros

  • {*} means 'any text'.
  • {%} means 'next parameter'.
  • {%,N} means 'next parameter takes exactly N following characters'.

Message template macros and tags

  • %1 means 'the first parameter'.
  • %2 means 'the second parameter'.
  • %3 means 'the third parameter'.
  • ...
  • %N means 'the N-th parameter' and so on.
  • \n or <BR> inserts a line break.
  • <P> inserts a paragraph break.
  • <HR> inserts a horisontal line (ruler).
  • <A href="...">...</a> inserts a hyperlink.
  • <LI> means 'new list item' (the text after this macro appears on the next line indented and marked with a bullet).
  • <B>...</B> pair makes the text inside appear as bold.
  • <I>...</I> pair makes the text inside appear as italic.
  • <U>...</U> pair makes the text inside appear as underlined.

Date / Time macros

These macros can be used in both search pattern and message templates. They are case-sensitive:

  • %Y - 4-digit year value.
  • %YY - 2-digit zero-padded year value.
  • %M - month value.
  • %MM - 2-digit zero-padded month value.
  • %MMM - short month name ('Jan', 'Feb', etc.).
  • %MMMM - full month name ('January', 'February', etc.).
  • %D - day value.
  • %DD - 2-digit zero-padded day value.
  • %W - 1-digit day of the week value (1 ù Sunday, 2 ù Monday, ..., 7 ù Saturday).
  • %WW - 2-digit day of the week value (1 ù Sunday, 2 ù Monday, ..., 7 ù Saturday).
  • %WWW - short day name ('Sun', 'Mon', etc.).
  • %WWWW - full day name ('Sunday', 'Monday', etc.).
  • %w - 1-digit day of the week value (1 ù Monday, 2 ù Tuesday, ..., 7 ù Sunday).
  • %ww - 2-digit day of the week value (1 ù Monday, 2 ù Tuesday, ..., 7 ù Sunday).
  • %h - hour value.
  • %hh - 2-digit zero-padded hour value.
  • %m - minutes value.
  • %mm - 2-digit zero-padded minutes value.
  • %s - seconds value.
  • %ss - 2-digit zero-padded seconds value.

You can add prefixes to the date / time macros. These are case-sensitive:

  • Msg - for the message date / time.
  • Last - for the last check date / time.

This means that if you use %MsgY, the message date's year value will be used;
%LastDDù last try date's day value will be used and so on. With no prefix, the current date and time are used.

Simple example

When the html page is loaded, WatzNew applies the search pattern first. The date / time macros are inserted before the search is performed, so you can make date-based search.

Sample search pattern:

<H1>{%}</H1>
This means: find the first occurence of <H1> in the html document and treat any text between it and the following occurence of </H1> as the first parameter (that corresponds to %1 in message template).

After then the extracted parameters are substituted into the message template.

Sample message template:

Current article: %1
This means: substitute %1 with the first parameter found.

If we apply the above rules to the following sample html document
...
<BODY>
<H1>"How to become rich?" by John Poor</H1>
...
</BODY>
we will get "Current article: "How to become rich?" by John Poor" message.

Now, when the text between <H1> and </H1> is changed, we will be notified with such a message as soon as WatzNewÖ checks the channel for updates.

Note: Pattern search is case-insensitive but date / time macros that are inserted before search, are case-sensitive; each found parameter is processed on the following scheme: html tags (simply all text between < and >) are stripped; all &nbsp; are converted to spaces; all &nn; and &nnn; and such codes as &copy;, &reg;, &quot; are converted to corresponding characters; the resulting strings are trimmed (all leading and trailing spaces and control characters are removed).

Please take a look at the more complex example of using search patterns and message templates.

See next

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