5 Cent tip for today [ modified? url ]

Featuring the Dragonfly web framework
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

5 Cent tip for today [ modified? url ]

Post by newdep »

Had some good practice from the examples of Nigel, HPW and Lutz so
I hope a more lispy result below ;-)

;
; Returns the modification date of the url
; ...no regex used, slower but readable...
;
; (modified? "http://newlisp.org/download/newlisp_manual.html" )
; (modified? "http://newlisp.org" )
;
; as an extention you could store the output in a local file
; and check the result against the previously checked result.
;
(define (modified? page, url )
(slice (set 'url (slice
(set 'url (get-url page "header" ))
(find "Last-Modified" url 0))) 0 (find "\r\n" url)))



Norman.

Locked