Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: questions concerning using perl to monitor webpages

by @ncientgoose (Novice)
on May 22, 2003 at 04:18 UTC ( #259976=note: print w/replies, xml ) Need Help??

in reply to questions concerning using perl to monitor webpages

use this bit to get the page code
use Net::HTTP; my $link = ''; $link =~ s/.+:\/\/(.+)/$1/ if ($link =~ /.+:\/\/.+/); my $s = Net::HTTP->new(Host => "$link") || 0; my $htmlcode = ''; if ($s) { $s->write_request(GET => "/", 'User-Agent' => "Mozilla/5.0"); my($code, $mess, %h) = $s->read_response_headers; while ($n = $s->read_entity_body($buf, 1024)) { $htmlcode .= "$buf"; } }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259976]
Discipulus is Corion reading 'Gory details of parsing quoted constructs'?..
[perldigious]: That's awesome erix. One of my work friends, who coincidentally convinced me to learn Perl originally, has a Finnish pen-pal. I showed him this and he immediately wanted to send it along to her.

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2016-12-06 16:22 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (112 votes). Check out past polls.