German Website
Home Features Screenshots Videos Downloads Shop Knowledgebase

Search Knowledgebase:


Automatically download all EXE files of a page

User question:

> I'm monitoring a download page and want to automatically download

> all EXE files when the page has been changed. Can this be done with

> WSW?


You can do this with a private plugin. If WebSite-Watcher then detects an update, all EXE files will be downloaded with the Download Manager.


Sub Wsw_ActionsOnUpdate($iUpdateStatus, ByRef $sStatusMessage, ByRef $iStatusCode)
   ' $iUpdateStatus ... 1 = initialized, 2 = updated, 3 = error
   ' $iStatusCode ... 0 = no error (default), 1 = error
   If $iUpdateStatus = 2 Then
      ' Bookmark was updated
      Dim $i, $sUrl, $sCheckUrl, $sMem
      'Load new version of the page
      $sMem = Bookmark_LoadCacheFile(2)
      'Extract all link URLs
      $sCheckUrl = Bookmark_GetProperty("check_url")
      Dim $sUrlList = HtmlExtract($sMem, $sCheckUrl, 0)
      'Loop through bookmark list and download exe files
      For $i = 0 To StringList_ItemCount($sUrlList) - 1
         $sUrl = StringList_GetItem($sUrlList, $i)
         If LCase(Right($sUrl, 4)) = ".exe" Then
            AddToDownloadManager($sUrl, False)
         End If
   End If
End Sub