finding time when url was modified

Ajay abra9823 at mail.usyd.edu.au
Mon Sep 27 22:02:37 EDT 2004


Quoting Steve Holden <steve at holdenweb.com>:

> Ajay wrote:
>
> > hi!
> >
> > i am reading a file on the Web. How can i find out when it was last
> > modified?
> >
> > thanks
> >
> That would be the "Last-Modified" HTTP header, when it's present.
>
> Python 2.3.4 (#1, Jun 13 2004, 11:21:03)
> [GCC 3.3.1 (cygming special)] on cygwin
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> from urllib import urlopen
>  >>> f = urlopen("http://www.holdenweb.com/")
>  >>> print f.headers
> Server: Microsoft-IIS/5.0
> Date: Tue, 28 Sep 2004 01:50:38 GMT
> Content-Type: text/html
> Accept-Ranges: bytes
> Last-Modified: Wed, 25 Aug 2004 17:47:51 GMT
> ETag: "242599a4cb8ac41:f460"
> Content-Length: 12456
>
> Oops, time I reinstalled the auto-update code to keep my Python links
> fresh!

is it possible for someone to change the Last-Modified header? Can someone
put a new updated document, but in such a way that if someone requests
that document, they get an old date rather than the new date?
i can see a CGI script add its own header and then write out the document.
but can this be done with a simple HTML page?

thanks




>
> regards
>   Steve
> --
> http://mail.python.org/mailman/listinfo/python-list
>


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list