in reply to Re: (Ovid) Re: Checking external links for inappropriate content
in thread Checking external links for inappropriate content
Where $res is your result objectif ($res->is_success) { #Normal retrievel of content stuff }else{ #check for redirects if ($res->code() =~ /30[12]/){ #redirect codes (temp/perm) #grab the location my $remote_cgi = $res->header('Location'); { # Some servers erroneously return a relative URL for redirects, # so make it absolute if it not already is. local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1; my $base = $res->base; $remote_cgi = $HTTP::URI_CLASS->new($remote_cgi,$base)->abs($ba +se); } }else{ # Request failed normaly, broken link }
|
|---|