Is there any scala library that can be used to generate RSS Feeds using idiomatic features like case classes? Even better if it provides helpers for using with Play framework.
Well, the embedded XML DSL is an idiomatic (if somewhat lambasted) feature, so I don't see why you'd need any library support. Just take a bit of RSS XML, which is valid Scala, and put in some variable content:
val myRss =
<rss version="2.0">
<channel>
<title>An example RSS feed</title>
<description>La dee daah</description>
<link>http://www.example.com/rss</link>
<lastBuildDate>Mon, 05 Oct 2012 11:12:55 =0100 </lastBuildDate>
<pubDate>Tue, 06 Oct 2012 09:00:00 +0100</pubDate>
{
for (itemTitle <- List("foo", "bar", "baz")) yield {
<item>
<title>{itemTitle}</title>
<description>This is an example of an Item</description>
<link>http://www.example.com/item</link>
<guid isPermaLink="false">123</guid>
<pubDate>Tue, 06 Oct 2012 13:00:00 +0100</pubDate>
</item>
}
}
</channel>
</rss>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With