I haven't yet gotten to the point of running it from cron; so far I'm still testing it on the command line, but it's successfully writing these files, so permissions don't seem to be a problem.
I have the minimal test reading successfully from cURL, and doing everything that the main script is doing to the Parser object.
#!/usr/bin/perl
use strict;
use Data::Dumper;
use Net::Curl::Easy qw(:constants);
use XML::RSS::Parser;
my $ua_string = "User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; r
+v:30.0) Gecko/20100101 Firefox/30.0";
my $curl = Net::Curl::Easy->new;
my $feedsrc = "https://feeds.simplecast.com/o4MKcfjK";
my $feed;
$curl->pushopt(CURLOPT_HTTPHEADER, [$ua_string]);
$curl->setopt(CURLOPT_NOPROGRESS, 0);
$curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
$curl->setopt(CURLOPT_CONNECT_ONLY, 0);
$curl->setopt(CURLOPT_URL, $feedsrc);
$curl->setopt(CURLOPT_WRITEDATA, \$feed);
$curl->perform();
my $parser = XML::RSS::Parser->new();
$parser->register_ns_prefix('lc_itunes', 'http://www.itunes.com/dtds/p
+odcast-1.0.dtd');
my $rss = $parser->parse_string($feed);
print $rss . "\n";
Which results in:
$ ./test.pl
% Total % Received % Xferd Average Speed Time Time Time
+ Current
Dload Upload Total Spent Left
+ Speed
100 164k 100 164k 0 0 1267k 0 --:--:-- --:--:-- --:--:
+-- 1271k
XML::RSS::Parser::Feed=HASH(0x618af3317380)
So that's working. I just can't see why it's breaking as part of the actual script, when it's clearly readable in isolation, and works fine on a different machine. |