Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Perl: get website title

Perl: get website title
{filelink=13227}

  use LWP;
  die "Please, get website URL" unless @ARGV;
  foreach $url (@ARGV) {
      $ua = LWP::UserAgent->new( );
      $res = $ua->get($url);
      print "$url: " if @ARGV > 1;
      if ($res->is_success) {
          print $res->title, "n";
      } else {
          print $res->status_line, "n";
      }
  }

No comments yet.

Leave a Comment