Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Smart Webpage Update Checker


  • Please log in to reply
10 replies to this topic
Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
This script has tray menu (and tooltip menu) driven interface. It's used to check if a webpage is updated. Its best used for a batch of webpages so you'll save a lot of time.

As many pages have advts. or visitor counters or other irrelevant stuff that keeps on updating but you don't want it to be considered so I've made this script seek only that part of the page that is relevant to you.

Once you start the script, select 'Add new url' from tray menu. now paste the url from IE's (or some better browser's) address bar here.
eg.
http://www.autohotkey.com/changelog/PendingChanges.htm

The next window asks you to input the 'Starting Code'. This is the important part, you enter some part from the webpage that is above the part that you want to check for updates. For best results (and to avoid problems due to subcoding between html text) use View> Source in browser and use a line directly from there.
eg.
The following are the highest priority pending changes

The next window asks the 'Ending Code'. This simply is some part of page that appears below the relevant part of webpage (or the relevant part's last line). Extract it the same way as starting code.
eg.


Add more urls similarly and it'll come in handy for checking many page updations at one go.

Maybe the usage is difficult for newbies (or maybe not) but surely not for scriptors. I'd to insert this a bit complex procedure, so to bypass irrelevant page updates... otherwise simple 'urldownload -> check with prev saved' should've been a lot easier, but not worth it.

And yeah, in case somebody's wondering, the debug menu option simply enables/disables standard menu options.

Debug = -1


#persistent
SetBatchLines, 10ms


Menu, tray, Icon, %ProgramFiles%\Internet Explorer\iexplore.exe, 1

Menu, tray, nostandard
Menu, tray, add, Add new URL, newurl
Menu, tray, add, Check All URLs, CheckAll
Menu, tray, add
Menu, tray, add, Check Particular URL, Check
Menu, tray, add, Remove Particular URL, Remove
Menu, tray, add, Edit Particular URL, EditURL
Menu, tray, add
Menu, tray, add, Debug
Menu, tray, add, Restart
Menu, tray, add, Exit, Quit
Menu, tray, add


;URL# has url
;URL#x has starting code
;URL#y has ending code
Loop, read, %a_scriptdir%\WebWatch.ini
{
	IfNotInString, a_loopreadline, http://, Continue
	
	num++
	
	StringGetPos, eqpos, a_loopreadline, =
	StringLeft, URL%num%, a_loopreadline, %eqpos%
	StringTrimRight, URLx, URL%num%, 0
	IniRead, param, %a_scriptdir%\WebWatch.ini, WebWatch, %URLx%
	StringGetPos, sep, param, |***|
	StringLeft, URL%num%x, param, %sep%
	sep +=5
	StringTrimLeft, URL%num%y, param, %sep%
}



	
;URL#name has main id of website
;URL#data has relevant code
Loop, %num%
{
	StringGetPos, spos, URL%a_index%, //
	spos += 2
	StringTrimLeft, URL%a_index%name, URL%a_index%, %spos%
	StringReplace, URL%a_index%name, URL%a_index%name, /, _, All

	StringTrimRight, currname, URL%a_index%name, 0
	StringTrimRight, currdata, URL%a_index%data, 0
}


Exit


;___________________________________________



CheckAll:
	
	;%updated% has list of updated websites delimited by `n
	Updated =
	Loop, %num%
	{
		StringTrimRight, currurl, URL%a_index%, 0
		StringTrimRight, currname, URL%a_index%name, 0
		StringTrimRight, currdata, URL%a_index%data, 0
		StringTrimRight, currx, URL%a_index%x, 0
		StringTrimRight, curry, URL%a_index%y, 0

		Currdata =
		Loop, read, %a_scriptdir%\%currname%.txt
			currdata = %currdata%`n%a_loopreadline%

		StringTrimLeft, currdata, currdata, 1
		URL%a_index%data = %currdata%



		TempIndex = %A_Index%
		

		Random, randa, 1, 99999
		Random, randb, 1, 99999
		FileDelete, %temp%\temp.html
		IfLess, Debug, 0, URLDownloadToFile, %currurl%?fakeParam=%Randa%%Randb%, %temp%\temp.html
		IfGreater, Debug, 0, URLDownloadToFile, %currurl%, %temp%\temp.html

		x = 0
		y = 0
		tempdata =
		Loop, read, %temp%\temp.html
		{
			IfEqual, x, 0, IfNotInString, a_loopreadline, %currx%, continue

			IfEqual, x, 0
			{
				StringGetPos, xpos, a_loopreadline, %currx%
				StringLen, len, currx
				xpos += %len%
				StringTrimLeft, templine, a_loopreadline, %xpos%
				x = 1
			}

			IfNotEqual, x, 0, Setenv, templine, %a_loopreadline%


			IfInString, templine, %curry%
				y = 1

			tempdata = %tempdata%`n%templine%
			IfEqual, y, 1, break
		}

		StringTrimLeft, tempdata, tempdata, 1

		IfNotEqual, tempdata,, IfNotEqual, currdata, %tempdata%
		{
			FileDelete, %a_scriptdir%\%currname%.txt
			FileAppend, %tempdata%, %a_scriptdir%\%currname%.txt
			StringTrimRight, URL%TempIndex%data, tempdata, 0

			Updated = %Updated%`n%currurl%
			
			msgbox, 4, WebWatch, %currurl% updated`n`n Do you want to see the updated page?
			IfMsgBox, Yes, Run, %currurl%?fakeParam=%Randa%%Randb%
		}
	}
	StringTrimLeft, Updated, Updated, 1

	IfEqual, Updated,, TrayTip,, No Updates, 1
Return	




;___________________________________________


newurl:
	InputBox, newURL, WebWatch, Enter the URL for update check:
	IfEqual, errorlevel, 1, Return
	IfEqual, newURL,, Return
	IfNotInString, newURL, http://, SetEnv, newURL, http://%newURL%
	InputBox, newURLx, WebWatch, Enter the URL's starting code:
	IfEqual, errorlevel, 1, Return
	IfEqual, newURL,, Return
	InputBox, newURLy, WebWatch, Enter the URL's ending code:
	IfEqual, errorlevel, 1, Return
	IfEqual, newURL,, Return
	
	IniWrite, %newURLx%|***|%newURLy%, %a_scriptdir%\WebWatch.ini, WebWatch, %newURL%
	
	Msgbox, 4, WebWatch, The program needs to restart to process new URL.`nRestart now?
	IfMsgbox, Yes, Reload
Return



;___________________________________________


Check:
	Gosub, ShowMenu
	IfGreater, mY, %MenuItems%, Return

	StringTrimRight, currurl, URL%mY%, 0
	StringTrimRight, currname, URL%mY%name, 0
	StringTrimRight, currx, URL%mY%x, 0
	StringTrimRight, curry, URL%mY%y, 0
	
	Currdata =
	Loop, read, %a_scriptdir%\%currname%.txt
		currdata = %currdata%`n%a_loopreadline%

	StringTrimLeft, currdata, currdata, 1
	URL%mY%data = %currdata%




	;Checking particular URL
	
	Random, randa, 1, 99999
	Random, randb, 1, 99999
	FileDelete, %temp%\temp.html
	IfLess, Debug, 0, URLDownloadToFile, %currurl%?fakeParam=%Randa%%Randb%, %temp%\temp.html
	IfGreater, Debug, 0, URLDownloadToFile, %currurl%, %temp%\temp.html

	x = 0
	y = 0
	tempdata =
	Updated =
	Loop, read, %temp%\temp.html
	{
		IfEqual, x, 0, IfNotInString, a_loopreadline, %currx%, continue

		IfEqual, x, 0
		{
			StringGetPos, xpos, a_loopreadline, %currx%
			StringLen, len, currx
			xpos += %len%
			StringTrimLeft, templine, a_loopreadline, %xpos%
			x = 1
		}

		IfNotEqual, x, 0, Setenv, templine, %a_loopreadline%


		IfInString, templine, %curry%
			y = 1

		tempdata = %tempdata%`n%templine%
		IfEqual, y, 1, break
	}
	StringTrimLeft, tempdata, tempdata, 1



	IfNotEqual, tempdata,, IfNotEqual, currdata, %tempdata%
	{
		FileDelete, %a_scriptdir%\%currname%.txt
		FileAppend, %tempdata%, %a_scriptdir%\%currname%.txt
		StringTrimRight, URL%mY%data, tempdata, 0

		Updated = %Updated%`n%currurl%
	}
	StringTrimLeft, Updated, Updated, 1
	


	IfNotEqual, Updated,
	{
		MsgBox, 4, WebWatch, %currurl% is updated.`nDo you want to see the updated page?
		IfMsgbox, Yes, run, %currurl%
	}
	
	IfEqual, Updated,, TrayTip,, No Updates, 1

Return


;___________________________________________


Remove:
	Gosub, ShowMenu
	IfGreater, mY, %MenuItems%, Return

	StringTrimRight, currurl, URL%mY%, 0
	StringTrimRight, currname, URL%mY%name, 0

	Msgbox, 4, WebWatch, Confirm deletion of all data relating to`n%currurl%
	IfMsgbox, yes
	{
		IniDelete, %a_scriptdir%\WebWatch.ini, WebWatch, %currurl%
		FileDelete, %a_scriptdir%\%currname%.txt
		ToDo =
		Return
	}
Return



;___________________________________________


EditURL:
	Gosub, ShowMenu
	IfGreater, mY, %MenuItems%, Return

	StringTrimRight, currurl, URL%mY%, 0
	StringTrimRight, currx, URL%mY%x, 0
	StringTrimRight, curry, URL%mY%y, 0

	InputBox, newx, WebWatch, Enter the URL's starting code:,,,,,,,, %currx%
	InputBox, newy, WebWatch, Enter the URL's ending code:,,,,,,,, %curry%
	
	IniWrite, %newx%|***|%newy%, %a_scriptdir%\WebWatch.ini, WebWatch, %currurl%
	
	Msgbox, 4, WebWatch, The program needs to restart to process new info.`nRestart now?
	IfMsgbox, Yes, Reload

Return



;___________________________________________

		
ShowMenu:
	MenuTitle = Select URL to check
	URLMenu = %MenuTitle%
	MenuItems =
	Loop, %Num%
	{
		StringTrimRight, currurl, URL%a_index%, 0
		MenuItems ++

		URLMenu = %URLMenu%`n%currurl%
	}

	MouseGetPos, mX, mY

	ToolTip, %URLMenu%, %mX%, %mY%
	WinActivate, %MenuTitle%

	
	
	;Waiting for mouse button down

	Loop
	{
		GetKeyState, State, LButton
		if State = D
			Break
		Sleep, 10
	}


	IfWinNotActive, %MenuTitle%
	{
		ToolTip
		Return
	}

	CoordMode, Mouse, Relative
	MouseGetPos, mX, mY
	ToolTip
	mY -= 3		;space after which first line starts
	mY /= 13	;space taken by each line
Return	




;___________________________________________
Debug:
	menu, tray, ToggleCheck, Debug
	Debug *= -1
	IfGreater, Debug, 0, Menu, tray, standard
	IfLess, Debug, 0, Menu, tray, nostandard
Return


Restart:
	Reload
Return


Quit:
	ExitApp
Return

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
a note: The 'Starting Code' and 'Ending Code' must be unique on the page and exist on a single line HTML code each.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Very elaborate, thanks for sharing it.

Anon
  • Guests
  • Last active:
  • Joined: --
:shock: I just wrote something much like this in JScript, but mine provides access to ie's application api and the dom api. I've been doing a great deal of work on figuring out how to differentiate semantic changes from simple markup/language touchup changes.

This is a -hugely- powerful direction to explore.

pipo
  • Members
  • 51 posts
  • Last active: Aug 31 2011 09:32 PM
  • Joined: 18 Oct 2006
is there a way to exclude strings from the comparison by adding a menuitem that writes these exceptions in the ini?
i'd like to use the script to check a torrent page that keeps updating seeders en downloaders as well and thereby rendering the present script unusable.

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
try selecting some part above or below the stuff, that changes but is irrelevant.

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
You can also use HttpQueryInfo to extract the Last-Modified date returned by the server.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


pipo
  • Members
  • 51 posts
  • Last active: Aug 31 2011 09:32 PM
  • Joined: 18 Oct 2006
Im afraid that the parts in the text that i mean that needs skipping, are in the same sentences of the info i'd like to see updated.
-----------------------------------------
href="details.php?id=21594&hit=1">somedownload.torrent

2006-10-19 05:27:19
4
align=center>670
hours <--------
358.73
MB

132
times <----------------------------
..
so do i understand that it will be very hard to have some pieces of text excluded?..
---------------------------
webwatch.ini
[WebWatch]
http://www.torrentpa... ... n.gif|***|ignore:hit=***;tocomm=***;***
hours,***
times
---------------------------

willigis
  • Members
  • 23 posts
  • Last active: Mar 26 2008 05:10 PM
  • Joined: 17 Feb 2005
Great work, I'm going to use this :)

There is a bug which makes it impossible to check php-Sites:
Adresses with "=" are not working. They are saved to the last character before the "=", eg. "...board.php?boardid=11" is saves as "board.php?boardid" and the "=11" is misteriously flipped and put at the beginning of the start code. In this example, the "" is converted to "11=body". Very strange behaviour ;)

Rajat
  • Members
  • 1904 posts
  • Last active: Jul 17 2015 07:45 AM
  • Joined: 28 Mar 2004
yeah.. that's probably bcoz of a var naming convention i used when i didn't know that it'll not work in 100% circumstances! :p

MIA

CleanNews.in : Bite sized latest news headlines from India with zero bloat


Zar'Rok
  • Guests
  • Last active:
  • Joined: --
I was looking for a way to make it automatically check for updates, and I know there is a better way to do this, but i'm a n00b. so heres my attempt at it.
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Debug = -1


#persistent
SetBatchLines, 10ms


Menu, tray, Icon, %ProgramFiles%\Internet Explorer\iexplore.exe, 1

Menu, tray, nostandard
Menu, tray, add, Credit, credits
Menu, tray, add, Add new URL, newurl
Menu, tray, add, Check All URLs, CheckAll
Menu, tray, add
Menu, tray, add, Check Particular URL, Check
Menu, tray, add, Remove Particular URL, Remove
Menu, tray, add, Edit Particular URL, EditURL
Menu, tray, add
Menu, tray, add, Debug
Menu, tray, add, Restart
Menu, tray, add, Exit, Quit
Menu, tray, add
Menu, tray, add, Auto-check updates, Autocheck


;URL# has url
;URL#x has starting code
;URL#y has ending code
Loop, read, %a_scriptdir%\WebWatch.ini
{
   IfNotInString, a_loopreadline, http://, Continue
   
   num++
   
   StringGetPos, eqpos, a_loopreadline, =
   StringLeft, URL%num%, a_loopreadline, %eqpos%
   StringTrimRight, URLx, URL%num%, 0
   IniRead, param, %a_scriptdir%\WebWatch.ini, WebWatch, %URLx%
   StringGetPos, sep, param, |***|
   StringLeft, URL%num%x, param, %sep%
   sep +=5
   StringTrimLeft, URL%num%y, param, %sep%
}



   
;URL#name has main id of website
;URL#data has relevant code
Loop, %num%
{
   StringGetPos, spos, URL%a_index%, //
   spos += 2
   StringTrimLeft, URL%a_index%name, URL%a_index%, %spos%
   StringReplace, URL%a_index%name, URL%a_index%name, /, _, All

   StringTrimRight, currname, URL%a_index%name, 0
   StringTrimRight, currdata, URL%a_index%data, 0
}


Exit


;___________________________________________



CheckAll:
   
   ;%updated% has list of updated websites delimited by `n
   Updated =
   Loop, %num%
   {
      StringTrimRight, currurl, URL%a_index%, 0
      StringTrimRight, currname, URL%a_index%name, 0
      StringTrimRight, currdata, URL%a_index%data, 0
      StringTrimRight, currx, URL%a_index%x, 0
      StringTrimRight, curry, URL%a_index%y, 0

      Currdata =
      Loop, read, %a_scriptdir%\%currname%.txt
         currdata = %currdata%`n%a_loopreadline%

      StringTrimLeft, currdata, currdata, 1
      URL%a_index%data = %currdata%



      TempIndex = %A_Index%
      

      Random, randa, 1, 99999
      Random, randb, 1, 99999
      FileDelete, %temp%\temp.html
      IfLess, Debug, 0, URLDownloadToFile, %currurl%?fakeParam=%Randa%%Randb%, %temp%\temp.html
      IfGreater, Debug, 0, URLDownloadToFile, %currurl%, %temp%\temp.html

      x = 0
      y = 0
      tempdata =
      Loop, read, %temp%\temp.html
      {
         IfEqual, x, 0, IfNotInString, a_loopreadline, %currx%, continue

         IfEqual, x, 0
         {
            StringGetPos, xpos, a_loopreadline, %currx%
            StringLen, len, currx
            xpos += %len%
            StringTrimLeft, templine, a_loopreadline, %xpos%
            x = 1
         }

         IfNotEqual, x, 0, Setenv, templine, %a_loopreadline%


         IfInString, templine, %curry%
            y = 1

         tempdata = %tempdata%`n%templine%
         IfEqual, y, 1, break
      }

      StringTrimLeft, tempdata, tempdata, 1

      IfNotEqual, tempdata,, IfNotEqual, currdata, %tempdata%
      {
         FileDelete, %a_scriptdir%\%currname%.txt
         FileAppend, %tempdata%, %a_scriptdir%\%currname%.txt
         StringTrimRight, URL%TempIndex%data, tempdata, 0

         Updated = %Updated%`n%currurl%
         
         msgbox, 4, WebWatch, %currurl% updated`n`n Do you want to see the updated page?
         IfMsgBox, Yes, Run, %currurl%?fakeParam=%Randa%%Randb%
      }
   }
   StringTrimLeft, Updated, Updated, 1

   IfEqual, Updated,, TrayTip,, No Updates, 1
Return   




;___________________________________________


newurl:
   InputBox, newURL, WebWatch, Enter the URL for update check:
   IfEqual, errorlevel, 1, Return
   IfEqual, newURL,, Return
   IfNotInString, newURL, http://, SetEnv, newURL, http://%newURL%
   InputBox, newURLx, WebWatch, Enter the URL's starting code:
   IfEqual, errorlevel, 1, Return
   IfEqual, newURL,, Return
   InputBox, newURLy, WebWatch, Enter the URL's ending code:
   IfEqual, errorlevel, 1, Return
   IfEqual, newURL,, Return
   
   IniWrite, %newURLx%|***|%newURLy%, %a_scriptdir%\WebWatch.ini, WebWatch, %newURL%
   
   Msgbox, 4, WebWatch, The program needs to restart to process new URL.`nRestart now?
   IfMsgbox, Yes, Reload
Return



;___________________________________________


Check:
   Gosub, ShowMenu
   IfGreater, mY, %MenuItems%, Return

   StringTrimRight, currurl, URL%mY%, 0
   StringTrimRight, currname, URL%mY%name, 0
   StringTrimRight, currx, URL%mY%x, 0
   StringTrimRight, curry, URL%mY%y, 0
   
   Currdata =
   Loop, read, %a_scriptdir%\%currname%.txt
      currdata = %currdata%`n%a_loopreadline%

   StringTrimLeft, currdata, currdata, 1
   URL%mY%data = %currdata%




   ;Checking particular URL
   
   Random, randa, 1, 99999
   Random, randb, 1, 99999
   FileDelete, %temp%\temp.html
   IfLess, Debug, 0, URLDownloadToFile, %currurl%?fakeParam=%Randa%%Randb%, %temp%\temp.html
   IfGreater, Debug, 0, URLDownloadToFile, %currurl%, %temp%\temp.html

   x = 0
   y = 0
   tempdata =
   Updated =
   Loop, read, %temp%\temp.html
   {
      IfEqual, x, 0, IfNotInString, a_loopreadline, %currx%, continue

      IfEqual, x, 0
      {
         StringGetPos, xpos, a_loopreadline, %currx%
         StringLen, len, currx
         xpos += %len%
         StringTrimLeft, templine, a_loopreadline, %xpos%
         x = 1
      }

      IfNotEqual, x, 0, Setenv, templine, %a_loopreadline%


      IfInString, templine, %curry%
         y = 1

      tempdata = %tempdata%`n%templine%
      IfEqual, y, 1, break
   }
   StringTrimLeft, tempdata, tempdata, 1



   IfNotEqual, tempdata,, IfNotEqual, currdata, %tempdata%
   {
      FileDelete, %a_scriptdir%\%currname%.txt
      FileAppend, %tempdata%, %a_scriptdir%\%currname%.txt
      StringTrimRight, URL%mY%data, tempdata, 0

      Updated = %Updated%`n%currurl%
   }
   StringTrimLeft, Updated, Updated, 1
   


   IfNotEqual, Updated,
   {
      MsgBox, 4, WebWatch, %currurl% is updated.`nDo you want to see the updated page?
      IfMsgbox, Yes, run, %currurl%
   }
   
   IfEqual, Updated,, TrayTip,, No Updates, 1

Return


;___________________________________________


Remove:
   Gosub, ShowMenu
   IfGreater, mY, %MenuItems%, Return

   StringTrimRight, currurl, URL%mY%, 0
   StringTrimRight, currname, URL%mY%name, 0

   Msgbox, 4, WebWatch, Confirm deletion of all data relating to`n%currurl%
   IfMsgbox, yes
   {
      IniDelete, %a_scriptdir%\WebWatch.ini, WebWatch, %currurl%
      FileDelete, %a_scriptdir%\%currname%.txt
      ToDo =
      Return
   }
Return



;___________________________________________


EditURL:
   Gosub, ShowMenu
   IfGreater, mY, %MenuItems%, Return

   StringTrimRight, currurl, URL%mY%, 0
   StringTrimRight, currx, URL%mY%x, 0
   StringTrimRight, curry, URL%mY%y, 0

   InputBox, newx, WebWatch, Enter the URL's starting code:,,,,,,,, %currx%
   InputBox, newy, WebWatch, Enter the URL's ending code:,,,,,,,, %curry%
   
   IniWrite, %newx%|***|%newy%, %a_scriptdir%\WebWatch.ini, WebWatch, %currurl%
   
   Msgbox, 4, WebWatch, The program needs to restart to process new info.`nRestart now?
   IfMsgbox, Yes, Reload

Return



;___________________________________________

      
ShowMenu:
   MenuTitle = Select URL to check
   URLMenu = %MenuTitle%
   MenuItems =
   Loop, %Num%
   {
      StringTrimRight, currurl, URL%a_index%, 0
      MenuItems ++

      URLMenu = %URLMenu%`n%currurl%
   }

   MouseGetPos, mX, mY

   ToolTip, %URLMenu%, %mX%, %mY%
   WinActivate, %MenuTitle%

   
   
   ;Waiting for mouse button down

   Loop
   {
      GetKeyState, State, LButton
      if State = D
         Break
      Sleep, 10
   }


   IfWinNotActive, %MenuTitle%
   {
      ToolTip
      Return
   }

   CoordMode, Mouse, Relative
   MouseGetPos, mX, mY
   ToolTip
   mY -= 3      ;space after which first line starts
   mY /= 13   ;space taken by each line
Return   




;___________________________________________
Debug:
   menu, tray, ToggleCheck, Debug
   Debug *= -1
   IfGreater, Debug, 0, Menu, tray, standard
   IfLess, Debug, 0, Menu, tray, nostandard
Return


Restart:
   Reload
Return

Autocheck:
	Loop,24 ;24
	 {
	  TrayTip,, Scanning, 1 
       ;%updated% has list of updated websites delimited by `n
   Updated =
   Loop, %num%
   {
      StringTrimRight, currurl, URL%a_index%, 0
      StringTrimRight, currname, URL%a_index%name, 0
      StringTrimRight, currdata, URL%a_index%data, 0
      StringTrimRight, currx, URL%a_index%x, 0
      StringTrimRight, curry, URL%a_index%y, 0

      Currdata =
      Loop, read, %a_scriptdir%\%currname%.txt
         currdata = %currdata%`n%a_loopreadline%

      StringTrimLeft, currdata, currdata, 1
      URL%a_index%data = %currdata%



      TempIndex = %A_Index%
      

      Random, randa, 1, 99999
      Random, randb, 1, 99999
      FileDelete, %temp%\temp.html
      IfLess, Debug, 0, URLDownloadToFile, %currurl%?fakeParam=%Randa%%Randb%, %temp%\temp.html
      IfGreater, Debug, 0, URLDownloadToFile, %currurl%, %temp%\temp.html

      x = 0
      y = 0
      tempdata =
      Loop, read, %temp%\temp.html
      {
         IfEqual, x, 0, IfNotInString, a_loopreadline, %currx%, continue

         IfEqual, x, 0
         {
            StringGetPos, xpos, a_loopreadline, %currx%
            StringLen, len, currx
            xpos += %len%
            StringTrimLeft, templine, a_loopreadline, %xpos%
            x = 1
         }

         IfNotEqual, x, 0, Setenv, templine, %a_loopreadline%


         IfInString, templine, %curry%
            y = 1

         tempdata = %tempdata%`n%templine%
         IfEqual, y, 1, break
      }

      StringTrimLeft, tempdata, tempdata, 1

      IfNotEqual, tempdata,, IfNotEqual, currdata, %tempdata%
      {
         FileDelete, %a_scriptdir%\%currname%.txt
         FileAppend, %tempdata%, %a_scriptdir%\%currname%.txt
         StringTrimRight, URL%TempIndex%data, tempdata, 0

         Updated = %Updated%`n%currurl%
         
         msgbox, 4, WebWatch, %currurl% updated`n`n Do you want to see the updated page?
         IfMsgBox, Yes, Run, %currurl%?fakeParam=%Randa%%Randb%
      }
   }
   StringTrimLeft, Updated, Updated, 1

   IfEqual, Updated,, TrayTip,, No Updates, 1
	  sleep 600000 ;600000
	 }
msgbox, Done checking
Return

credits:
msgbox, All credit goes to Rajat and his "Smart Webpage Update Checker" `n(http://www.autohotkey.com/forum/topic550.html&highlight=website+update)
Return

Quit:
   ExitApp
Return