From: pdbogen Date: Thu, 17 Jun 2010 21:39:56 +0000 (+0000) Subject: Let's pass on a particular Agent string, and give back more information about failed... X-Git-Url: http://git.mmlx.us/?a=commitdiff_plain;h=a2ac57402bca7b1f27bc45efb36ff9df58b8d960;p=destult.git Let's pass on a particular Agent string, and give back more information about failed RSS feeds. git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@110 088b83a4-0077-4247-935c-42ec02c2848b --- diff --git a/commands.yaml b/commands.yaml index f21cad1..dd42173 100644 --- a/commands.yaml +++ b/commands.yaml @@ -959,12 +959,13 @@ RSS: |- use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(5); + $ua->agent( "Destult" ); my $req = HTTP::Request->new( GET => $url ); my $res = $ua->request( $req ); if( $res->is_success ) { $xml = $res->content; } else { - $kernel->post( $src, $replypath, "Failed to fetch RSS feed from $url", $dest ); + $kernel->post( $src, $replypath, "Failed to fetch RSS feed from $url: ".$res->code.": ".$res->message, $dest ); return; } my $rss = new XML::RSS;