summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>2015-03-28 13:26:51 +0000
committerGianni Ceccarelli <gianni.ceccarelli@net-a-porter.com>2015-03-28 13:26:51 +0000
commitef1cc4f8d69bb12783bbb98ee18f4bb881136da2 (patch)
tree145122e1a14bc17f5df0c2894cef2671c58ce972
parentsome feed updates (diff)
downloadfeeder-ef1cc4f8d69bb12783bbb98ee18f4bb881136da2.tar.gz
feeder-ef1cc4f8d69bb12783bbb98ee18f4bb881136da2.tar.bz2
feeder-ef1cc4f8d69bb12783bbb98ee18f4bb881136da2.zip
download OPML with proper UA, not libxml nanohttp
-rw-r--r--lib/Feed/Utils.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Feed/Utils.pm b/lib/Feed/Utils.pm
index 7a6c5bb..bf76d16 100644
--- a/lib/Feed/Utils.pm
+++ b/lib/Feed/Utils.pm
@@ -64,8 +64,15 @@ sub feeds {
sub feeds_from_opml {
my ($common_args,$opml_source,$opts) = @_;
+ # hack hack
+ my $ua = $feed_class->build_user_agent;
+
my $opml = try {
- XML::LibXML->load_xml(location => $opml_source);
+ my $response = $ua->get($opml_source);
+ die sprintf('Got code "%s" processing OPML %s',$response->status_line,$opml_source)
+ unless $response->is_success;
+
+ XML::LibXML->load_xml(string => $response->content);
} catch { warn $_; return };
return unless $opml;