Subscribe1) Set up a schedule task from your PC once a day to run a vbscript that will consume a list of URLs from a file, and do a simple vbscript that will output the page response to file. The list of sites would have to be something like this as list.txt. Each line would be some kind of friendlyname (no spaces or special characters), a comma, and then the actual link:
GoogleHome,http://www.google.com
YahooHome,http://www.yahoo.com
I've whipped up a simple vbscript that does just this, which I'll post shortly- you can go the Windows Scripting Center to get loads more info including a great Windows Script Host 5.2 downloadable help file that is an incredible resource for quickly learning vbscript. Search on winhttp if you want to learn more sophisticated tricks of winhttp.
2) Have a totally separate scheduled job that simply does a diff of the files from one day's scan to the next (if the file is a different size is probably good enough). That job is responsible for finding differences, and then emailing you, or otherwise leaving a "what's different" list of files that you can easily check. It could be as simply as a batch file that does "for every file in one folder, find the same file in this other folder and see if they're different", or simply using the windiff or fc utilities to do the same thing. I'll leave that as an exercise for you to solve- it shouldn't be too hard.
' Define root folder- this is where each day's "scan" will be stored
RootFolder = "D:\myPages\" ' this is the storage folder
myList = "list.txt" ' this is the list file
' Create necessary COM objects
set FSO = CreateObject("Scripting.FileSystemObject")
Set myHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
' on windows XP; if this errors out, try removing the .1
' Get current date, reformat it as the folder name mypages\YYYYMM_HHMM\, and create that folder
myFolderName = RootFolder & mytimeStamp(Now)
Set myFolder = FSO.CreateFolder(myFolderName)
'open the listfile
Set myURLs = FSO.OpenTextFile(myList, 1)
' Loop through the list until the file ends, i.e "atendofstream"
On Error Resume Next
Do while Not myURLs.AtEndOfStream
' split the line into a friendly name and the URL
myEntry = myURLs.ReadLine
arrItems = Split(myEntry, ",", -1, 1)
myFriendlyName = arrItems(0)
myLink = arrItems(1)
myHttp.Open "GET", myLink, False
myHttp.Send
' get the http status code and response text
myResponseCode = myHttp.Status
myResponseText = myHttp.ResponseText
'write the output to the file \friendlyname.txt
myOutputName = myFolderName & "\" & myFriendlyName & ".txt"
Set myOutputFile = FSO.CreateTextFile(myOutputName, True)
myOutputFile.WriteLine myResponseCode & vbCRLF & myResponseText
myOutputfile.Close
Set myOutputfile = nothing
Loop
wscript.quit
'-------------
' simply formats a date-time folder name
Function MytimeStamp(curTime)
myTime = curTime
myYear = DatePart("yyyy", myTime)
myMonth = DatePart("m", myTime)
if Len(myMonth) = 1 then myMonth = "0" & myMonth
myDate = Datepart("d", myTime)
if Len(myDate) = 1 then myDate = "0" & myDate
myHour = DatePart("h", myTime)
if Len(myHour) = 1 then myHour = "0" & myHour
myMin = DatePart("n", myTime)
if Len(myMin) = 1 then myMin = "0" & myMin
myTimeStamp = myYear & myMonth & myDate & "_" & myHour & myMin
End Function
You are not logged in, either login or create an account to post comments
At some level, you're either going to script something (which isn't hard, a quickie vbscript using winhttp will work fantastically well), or use macro-based software to drive an actual browser session (if you're going to rely on saved cookies, etc). There may be tools to auto-grab webpages, but a script is easy, and once you have it you can make it do just about anything you want.
posted by hincandenza at 7:31 PM on January 3, 2007