Wsw_CheckKeywords

Top  Previous  Next

Sub Wsw_CheckKeywords($sMemChanges, ByRef $sStatusMessage, ByRef $iKeywordFound)

 

This function is called when WebSite-Watcher looks for keywords. It can be used for advanced keyword processing with logical operators. The parameter $sMemChanges contains the new and changed text without HTML tags, carriage return linefeeds and duplicate blanks. $iKeywordFound is a numeric value and indicates whether keywords have been found.

 

If keywords are also entered in the bookmark properties (Update-On-Keywords), then this function is not called if one of the entered keywords has already been found. If no keywords are entered or none of the entered keywords were found (Update-On-Keywords), then WebSite-Watcher will call this function.

 

Parameters

 

$sMemChanges ... String expression. New/changed text of the web page (no HTML tags, no CRLFs, no duplicate blanks).
$sStatusMessage ... String expression. Status message that will be displayed in the status column. Default value is an empty string.
$iKeywordFound ... Integer value. Indicates if keywords were found. Default value is 0.

 

Valid values of $iKeywordFound:

0 ...

No keywords found.

Default value, must not be assigned manually.

1 ...

Keywords were found.

 

Example:

Sub Wsw_CheckKeywords($sMemChanges, ByRef $sStatusMessage, ByRef $iKeywordFound)

   

   Dim $s = $sMemChanges

   

   ' Look for WebSite Watcher but exclude weight watcher

   If KeywordExists($s, "website", True) And KeywordExists($s, "watcher", True) And Not (KeywordExists($s, "weight", True)) Then

      $iKeywordFound = 1

      Return

   End If

   

   If KeywordExists($s, "aignesberger", True) And KeywordExists($s, "watcher", True) Then

      $iKeywordFound = 1

      $sStatusMessage = "Keyword 'aignesberger + watcher' found"

      Return

   End If

   

End Sub