Alert only if there is more than 1 change

Top  Previous  Next

By default, WebSite-Watcher alerts an update as soon as a change is detected.


If you only want an update notification if there is for example more than one change, you can use the plugin below. You could also increase the value 1, for example to only get an update notification if there are more than 3 changes in the page.


Sub Wsw_CompareVersions(Handle, ByRef sMemWeb, ByRef sMemLocal, ByRef sStatusMessage, ByRef iStatusCode)


   Dim nNew, nChg, nDel


   ' Apply entered filter definitions

   sMemWeb = Bookmark_ApplyFilter(Handle, sMemWeb)

   sMemLocal = Bookmark_ApplyFilter(Handle, sMemLocal)


   ' Calculate the number of new/changed/deleted content

   GetComparisonInfo(sMemWeb, sMemLocal, 1, nNew, nChg, nDel)


   ' Alert only if there is more than 1 change

   If (nNew + nChg > 1) Then 

      iStatusCode = 1

   End If


End Sub