From: Gabor Szabo Date: Sun, 30 Dec 2012 20:48:13 +0000 (+0200) Subject: change the User Agent string X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FXML-Feed.git;a=commitdiff_plain;h=eeff6c3c6c4e342d9af5f2cecd0d2e59ac571280 change the User Agent string --- diff --git a/Changes b/Changes index 3870079..b8d94be 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ + + * Change the User Agent to identify as XML::Feed (SZABGAB) + as two sites refused to server the default user agent: + http://code.foo.no/feed gave 'Bad Behavior' + http://thorsen.pm/atom gave 'Forbidden' + 2012-04-10 Jakob Voss * Add support for RFC 5005 Feed Paging and Archiving in Atom feeds diff --git a/lib/XML/Feed.pm b/lib/XML/Feed.pm index 8c73473..d51ab5b 100644 --- a/lib/XML/Feed.pm +++ b/lib/XML/Feed.pm @@ -38,6 +38,7 @@ sub parse { my $xml = ''; if (UNIVERSAL::isa($stream, 'URI')) { my $ua = LWP::UserAgent->new; + $ua->agent(__PACKAGE__ . "/$VERSION"); $ua->env_proxy; # force allowing of proxies my $res = URI::Fetch->fetch($stream, UserAgent => $ua) or return $class->error(URI::Fetch->errstr);