Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are good scala libraries to generate RSS feeds? [closed]

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.

like image 379
Johnny Everson Avatar asked Aug 31 '12 17:08

Johnny Everson


1 Answers

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>
like image 56
Erik Post Avatar answered Oct 22 '22 22:10

Erik Post