Commit 658c3494 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Improve again the feed to validate a bit better

parent a64a5091
......@@ -138,6 +138,7 @@
if($this->version == RSS2 || $this->version == RSS1)
{
$this->addElement('link', $link);
$this->addElement('guid', FeedWriter::uuid($link,'urn:md5:'));
}
else
{
......
......@@ -215,6 +215,7 @@
$out .= '<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:atom="http://www.w3.org/2005/Atom"
>' . PHP_EOL;
}
elseif($this->version == RSS1)
......@@ -349,6 +350,10 @@
}
echo "</rdf:Seq>" . PHP_EOL . "</items>" . PHP_EOL . "</channel>" . PHP_EOL;
}
if($this->version == RSS2)
{
echo '<atom:link href="'.$this->channels['link'].'videolan-news.rss" rel="self" type="application/rss+xml" />'."\n";
}
}
/**
......
......@@ -4,12 +4,13 @@
require("include/FeedWriter/FeedItem.php");
//Creating an instance of FeedWriter class.
$TestFeed = new FeedWriter(ATOM);
$TestFeed = new FeedWriter(RSS2);
//Setting the channel elements
//Use wrapper functions for common channel elements
$TestFeed->setTitle('VideoLAN project - News feed');
$TestFeed->setLink('http://www.videolan.org/videolan-news.rss');
$TestFeed->setLink('http://www.videolan.org/');
$TestFeed->setChannelElement('language','en');
$TestFeed->setDescription('This is the main new feed from the VideoLAN project');
//Image title and link must match with the 'title' and 'link' channel elements for valid RSS 2.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment