From a2ac57402bca7b1f27bc45efb36ff9df58b8d960 Mon Sep 17 00:00:00 2001 From: pdbogen Date: Thu, 17 Jun 2010 21:39:56 +0000 Subject: [PATCH] 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 --- commands.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.11.0