'SimplePie v1.6 - URL works in Demo, but not in my (copied) code
Trying to track down problems in RSS feeds. When I run this particular URL in the SimplePie demo window (http://simplepie.org/demo/), it works fine.
But, in my own code, pulled from the demo/index.php file in the SimplePie v1.6 distribution:
$feed_url = 'https://www.keepingcurrentmatters.com/feed/';
print "Fetching rss items from [[]]$feed_url]]\n";
$feed = new SimplePie();
$feed->set_cache_location( "/tmp/cache");
$feed->set_feed_url($feed_url);
$success = $feed->init();
$feed->handle_content_type();
if ($feed->error())
{
print(" - ERRORS:");
print_r( $feed->error() );
}
print "LINK: " . $feed->get_link() . "\n";
print "TITLE: " . $feed->get_title() . "\n";
print "DESC: " . $feed->get_description() . "\n";
I get this output:
Fetching rss items from [[https://www.keepingcurrentmatters.com/feed/]]
PHP Notice: A feed could not be found at `https://www.keepingcurrentmatters.com/feed/`; the status code is `302` and content-type is `text/html; charset=UTF-8` in /home/httpd/idxv3/lib/SimplePie.php on line 1693
- ERRORS:
A feed could not be found at `https://www.keepingcurrentmatters.com/feed/`; the status code is `302` and content-type is `text/html; charset=UTF-8`
LINK:
TITLE:
DESC:
I've been crawling through the SimplePie code, but I cannot figure out why this doesn't work.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
