Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: questions concerning using perl to monitor webpages

by Abigail-II (Bishop)
on May 22, 2003 at 00:56 UTC ( #259955=note: print w/replies, xml ) Need Help??

in reply to questions concerning using perl to monitor webpages

The HTTP protocol helps, as there is a "If-Modified-Since" header. So, you could use LWP, create an user agent, and an HTTP Request object, set the "If-Modified-Since" header, do the request, and look at the return status of the response. If the status is 304, the content hasn't changed. If the status is 200, the content has changed. For any other status, see RFC 2068.


  • Comment on Re: questions concerning using perl to monitor webpages

Replies are listed 'Best First'.
Re: Re: questions concerning using perl to monitor webpages
by Trimbach (Curate) on May 22, 2003 at 02:00 UTC
    This is great in principle for truly static pages, but for CGI output the "If-modified-since" is, like, now. So it depends on what kind of pages you're going to fetch if this particular trick will work.

    It's dead easy to use, though, when it works. :-)

    Gary Blackburn
    Trained Killer

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259955]
[msh210]: perl -e'warn "test$/", "" '
[msh210]: doesn't append anything.
[msh210]: It should say "If the last nonempty element of LIST" or "If the string thus to be printed does not end in a newline""
[msh210]: Am I wrong?
[shmem]: no. You're right.
[msh210]: About time... last time I was right was... I don't even remember when.
[shmem]: perl -e 'warn "test$/", ^@^ '
[Eily]: well, at least it's right about warn doing the same thing as die :)
[shmem]: same with undef as last element
[msh210]: oh, good point. It's the best kind of correct

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (19)
As of 2017-04-24 12:41 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (439 votes). Check out past polls.