in reply to Re: help with link checking
in thread help with link checking
When this script is run, it will print GOOD. However, check out http://202.103.25.186/music/Phil%20Collins%20-%20That's%20What%20You%20Said.mp3 in your browser and you'll see that this doesn't serve up an mp3 file, rather an html page. What can I do?#!/usr/bin/perl use LWP::UserAgent; ($ua = LWP::UserAgent->new)->timeout(20); $url = "http://202.103.25.186/music/Phil%20Collins%20-%20That's%20What +%20You%20Said.mp3"; if(($ua->request(HTTP::Request->new('HEAD', $url)))->code() == 200) { print "GOOD\n"; } else { print "BAD\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: help with link checking
by merlyn (Sage) on Mar 07, 2001 at 02:14 UTC | |
by rmckillen (Novice) on Mar 07, 2001 at 04:13 UTC | |
by merlyn (Sage) on Mar 07, 2001 at 04:22 UTC |