diff options
author | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2015-03-28 13:26:51 +0000 |
---|---|---|
committer | Gianni Ceccarelli <gianni.ceccarelli@net-a-porter.com> | 2015-03-28 13:26:51 +0000 |
commit | ef1cc4f8d69bb12783bbb98ee18f4bb881136da2 (patch) | |
tree | 145122e1a14bc17f5df0c2894cef2671c58ce972 /lib | |
parent | some feed updates (diff) | |
download | feeder-ef1cc4f8d69bb12783bbb98ee18f4bb881136da2.tar.gz feeder-ef1cc4f8d69bb12783bbb98ee18f4bb881136da2.tar.bz2 feeder-ef1cc4f8d69bb12783bbb98ee18f4bb881136da2.zip |
download OPML with proper UA, not libxml nanohttp
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Feed/Utils.pm | 9 |
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; |