Results 1 to 8 of 8
  1. #1
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Determining when a file on a website was changed

    Remotely, I would like to have a minimum-effort method of determining whether a file on a website has changed. I can download the file, and compare it with the previously downloaded version, but when it's about 300 KB and I want to do this every 20 minutes or so, it is a bit of a waste of effort.

    Does anyone know of a program (which I could call from a BATch file <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23>) which could remotely obtain the date, time, and (maybe) size of a file on a website?

    Many Thanks!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  2. #2
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Determining when a file on a website was chang

    While we're waiting for the coding and scripting gurus, let me ask you a question, John. Is the file(s) in question something like a zip or executable that would normally open a download window when the URL is entered? The reason I ask is that the program AutoIt comes to mind. I don't know if it has any commands in its structure for looking at file properties, but it just popped into my head. (Obviously, you can tell and I freely admit that I'm over my head here)

  3. #3
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Determining when a file on a website was chang

    Al

    The full story is that I am checking every 20 minutes, 24x7, for updates to an antivirus ZIP file, and downloading it using a program called SGET (WGET is another version) whose syntax is
    SGET http://website.com/zippedfile.zip

    Since this can be a BIG file, I don't want to download it unless there has been a change to it, which I could find out by running this mythical program (with a similar syntax) to determine its timestamp on the webserver.
    If the timestamp is different from that I found 20 minutes ago,
    then I would download the ZIP file,
    otherwise I go to sleep for 20 mins.

    I'm sure AutoIt could be tweaked to do what I want, but it seems like overkill IF there's a program around which simply gives me the timestamp of the ZIP file on the website!

    Thanks for your suggestion!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  4. #4
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Determining when a file on a website was chang

    This is from List of Lists and in one of the revision history paragraphs says:
    <hr>Added option to run a program or batch file when an update is found. <hr>
    so I don't know what its behaviour would be if you pass it a filename-specific URL. But it's <img src=/S/free.gif border=0 alt=free width=30 height=15> and maybe not too difficult to tryout.

    http://www.markwell.btinternet.co.uk/webmon/

  5. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Determining when a file on a website was chang

    Thanks Al - I've downloaded it, and have written to the author to see if he'll change it to do what I want!!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  6. #6
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Nixa, Missouri, USA
    Posts
    314
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Determining when a file on a website was chang

    create a blank HTML page and name it something like "Last Updated"
    Open the properties and under the URL section enter:
    "java script:alert(document.lastModified)" san quotes
    I saved this as a "Favorites" and when I have a web page open I click on this and it tells me when the page was last modified.
    Problem 1: It does not directly address your desire however I think you can modify it to your need.
    Problem 2: Many time even though I see no change on the page it shows as modified, I think that if there is a hidden counter and you log on it counts that as a change.
    Just an idea.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Determining when a file on a website was chang

    Somewhere we had a thread about reading the HTTP headers that are returned to the browser during the process of retrieving a file. The poster was using some Windows ActiveX controls that didn't provide this information, and I posted some links to MS pages that provided C-style information on how to get it. If you can find a way to do it with just a header request, I think that would be the best approach.

  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Determining when a file on a website was chang

    Jefferson

    You've got most of the answer in your post! The author of the program to which Medium-Sized Al pointed me in turn pointed at WGET.

    WGET implements the "check the HTTP headers" mechanism and downloads a file from a web server to your PC only when the web copy is newer than the PC copy. The only funny I've found is that the downloaded file apparently has a timestamp an hour in advance of what you would expect -- even when I'm on British Summer Time = UTC+1, and so is the web server!

    Thanks to all contributors to this thread!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •