Jump to content
Sign in to follow this  
Hawkwing

Find website update.

Recommended Posts

Hawkwing

Could I save a website with autoit, and then have a loop comparing the saved file to the website? If so, what functions would I use?


The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Share this post


Link to post
Share on other sites
exodius

You could use INetGet, or _IECreate and _IEDocReadHTML...

Share this post


Link to post
Share on other sites
GEOSoft

Checking file size may be enough to do what you want. Otherwise this can easily be converted to do a file compare.

;
Local $sURL = "http://dundats.mvps.org/Windows/Win98/default.aspx"
Local $aPath = StringRegExp($sURL, "(?i)http:/(.*/)(.*\.).*\z", 1)
If NOT @Error Then
   $aPath[0] = StringReplace($aPath[0], "/", "\")
   If NOT FileExists(@ScriptDir & $aPath[0]) Then DirCreate(@ScriptDir & $aPath[0])
   $aPath[1] &= "htm"
   Local $sTemp = @ScriptDir  &  $aPath[0] & $aPath[1]
   If FileExists($sTemp) Then
      Local $iCurrSize = FileGetSize($sTemp)
      Local $iNewSize = InetGetSize($sURL, 1)
      If $iCurrSize <> $iNewSize Then
         _Download($sURL, $sTemp)
         If @Error Then MsgBox(0, "Error", "Unable to download " & $sURL & @CRLF & _
               "Make sure you entered the correct URL.")
         MsgBox(0, "Result", $sURL & " has changed")
      EndIf
   Else
      _DownLoad($sURL, $sTemp)
      If @Error Then MsgBox(0, "Error", "Unable to download " & $sURL & @CRLF & _
            "Make sure you entered the correct URL")
   EndIf
Else
   Exit
EndIf

Func _Download($sDownload, $sCopyTo)
   If NOT InetGetSize($sDownload, 1) Then Return SetError(1)
   Local $hDownload = InetGet($sDownload, $sCopyTo, 1, 1)
   Do
      Sleep(250)
   Until InetGetInfo($hDownload, 2) ; Check if the download is complete.
   InetClose($hDownload)    ; Close the handle to release resources.
EndFunc   ;<==> _Download()
;

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×