[CODE=perl]#/usr/bin/perl -w
use LWP::UserAgent;
use Time::HiRes qw(gettimeofday );
#use Crypt::SSLeay;
use strict;
print "Enter URL to Time GET request for... ";
my $host=<STDIN>;
chomp $host;
my $before=gettime ofday;
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new('GET', "$host");
my $response = $ua->request($reque st);
my $elapsed=gettim eofday-$before;
print "ERROR: Bad URL\n" if($response->is_error);
my @content=split/\n/,$response->content;
print "Request took $elapsed seconds.\n";
my @title=grep /(?:title|TITLE)/, @content;
print "TITLE LINE: @title \n";
[/CODE]
I'm using this script to see how fast it can get different pages.
I put www.thescripts.com as my page,
Enter URL to Time GET request for... ERROR: Bad URL
Request took 0.0080049037933 3496 seconds.
Why would it be a bad url?
use LWP::UserAgent;
use Time::HiRes qw(gettimeofday );
#use Crypt::SSLeay;
use strict;
print "Enter URL to Time GET request for... ";
my $host=<STDIN>;
chomp $host;
my $before=gettime ofday;
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new('GET', "$host");
my $response = $ua->request($reque st);
my $elapsed=gettim eofday-$before;
print "ERROR: Bad URL\n" if($response->is_error);
my @content=split/\n/,$response->content;
print "Request took $elapsed seconds.\n";
my @title=grep /(?:title|TITLE)/, @content;
print "TITLE LINE: @title \n";
[/CODE]
I'm using this script to see how fast it can get different pages.
I put www.thescripts.com as my page,
Enter URL to Time GET request for... ERROR: Bad URL
Request took 0.0080049037933 3496 seconds.
Why would it be a bad url?
Comment