Hi -
        Check out LWP::UserAgent and HTML::TokeParser.
The following script gets my SETI@home stats. Flesh it
out with you token parsing, better error handling, etc.

Aloha => Beau.

use strict;
use warnings;
use LWP::UserAgent;
use HTML::TokeParser;

        my $url =
"http://setiathome.ssl.berkeley.edu/cgi-bin/cgi?email=beau\@aloha.com&cmd=us
er_stats_new";

        my $agent = new LWP::UserAgent ();
        $agent->proxy (['http'] => 'http://10.10.10.1:8080');
        my $request = new HTTP::Request ('GET' => $url);
        my $response = $agent->request ($request);

        die "Error: " . $response->status_line () . "\n"
                unless $response->is_success ();

        my $document = $response->content ();
        my $page = new HTML::TokeParser (\$document);
        while (my $token = $page->get_token ()) {
                my $type = shift (@{$token});
                $_ = shift (@{$token});
                if ($type eq "T") {
                        print $_;
                        }
                }

-----Original Message-----
From: david [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 10:22 AM
To: [EMAIL PROTECTED]
Subject: getting a url with perl, the url_get library?


There used to be a url_get library, is there something else now? i couldn't
find anything on CPAN, this is a http protocol issue right? I just want to
have a user enter a url on a form page, then crawl that url for the
specified
text string. Thank you

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to