ScrewTurn is used as a CMS for Lokad.com. Along with the main website www.lokad.com, we have also blog.lokad.com and forums.lokad.com that both provide RSS feeds. For a long time, I have been looking for a simple way to include RSS snippets directly in the web pages without any satisfying solution. You can have a look at the right sidebar of Lokad Products page to see what I mean by "Feed Snippet".
Feed2js for RSS snippet inclusion
For one month, I have been using Feed2js.org that provide a javascript based solution to include RSS snippets in your webpages. The Feed2js approach has one single major advantage: simplicity. Just cut-and-paste a sample javascript that call Feed2js.org and you're done. Unfortunately, this approach has two major drawbacks. First, it's roughly double the latency to complete the webpage retrieval. With Lokad.com, the overhead delay was sufficient to be noticed even when a DSL connection. Second, it potentially expose your website to cross-scripting attack (I am only saying potentially because Feed2js.org has proved to be very reliable in my experience).
Feed Snippet Plugin for ScrewTurn
For those reasons, I have settled myself for an improved (yet home-made) solution for ScrewTurn: a custom RSS feed snippet plugin. This piece of code relies on the ScrewTurn plugin framework. It retrieve the RSS feed on the server side and then use the ASP.Net caching mechanism to keep a copy for 1h before re-downloading the RSS feed. With this plugin, you can include a RSS feed snippet in your ScrewTurn page with a single line:
<feed itemCount="4" dateFormat="yyyy-MMM-dd">http://myfeedurl</feed>
The attribute itemCount indicates the maximal number of RSS items to be displayed in the web page. The attribute dateFormat corresponds to the .NET DateTime formatting option to be used to display the post publication date.
Download: FeedSnippetPlugin.cs.zip