Simon Fell > Its just code > BlogThis
Monday, April 14, 2003
Has soaked up way more time than I'd like, I think I managed to upset pretty much everyone in the process. Anyway, I've settled on the XML based interface, that is contained in the last assembly I published.
namespace Syndication.Extensibility
{
public interface IBlogThis
{
void BlogItem(IXPathNavigable rssFragment) ;
}
}
The fragment should contain a RSS document containing the item of choice, the aggregator is free to use the source RSS as is (other than removing the additional items), or to generate a synthetic document from its internal data structures. no normalization of the source data is required. The document should conform to the spec for the RSS version it indicates itself to be.
Example, I selected Sam's post about xhtml:body in Radio from his RSS 0.91 feed, If the aggregator preserves the original RSS, then I'd get a document like
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
"http://my.netscape.com/publish/formats/rss-0.91.dtd">
<rss version="0.91">
<channel>
<title>Sam Ruby</title>
<link>http://www.intertwingly.net/blog/</link>
<description>It's just data</description>
<language>en-us</language>
<item>
<title>xhtml:body in Radio</title>
<link>http://www.intertwingly.net/blog/1333.html</link>
<description><p>
<a href="http://weblog.infoworld.com/udell/2003/04/14.html#a666">Jon
Udell</a>: <em>Sam Ruby and Don Box have both demonstrated valid
RSS 2.0 feeds that include a &lt;body&gt; element, properly
namespaced as XHTML. Quietly, last week, I joined the
party.</em></p>
<p>Way to go Jon!&nbsp; I'm very much looking forward to your
upcoming O'Reilly Network column.</p>
</description>
</item>
</channel>
</rss>
As stated above, the aggregator could also choose to send a synthesized RSS document, perhaps like
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Sam Ruby</title>
<link>http://www.intertwingly.net/blog/</link>
<description>It's just data</description>
<item>
<title>xhtml:body in Radio</title>
<link>http://www.intertwingly.net/blog/1333.html</link>
<description>Jon Udell: Sam Ruby and Don Box have both demonstrated valid RSS 2.0
feeds that include a &lt;body&gt; element, properly namespaced as XHTML.
Quietly, last week, I joined the party. Way to go Jon!&#160; I'm very
much looking forward to your upcoming O'Reilly Network column.</description>
<dc:date>2003-04-14T15:02:28-05:00</dc:date>
</item>
</channel>
</rss>
I'm specifically not indicating how the aggregator should find the plug-in, thats upto the aggregator writer. Don has a sample that pulls it from the config file, I posted a version of Syndirella that looks for assemblies in a plugins directory that implement the interface, I'm sure there are plenty of other approaches as well.