Skip to content

fredszaq/ssu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scala Syndication Utils (SSU) Build Status

SSU is a simple and fluent Scala library to generate RSS feeds.

Creating a simple RSS feed

val items = ("title1", "content1", new URL("http://link1.com"), "author1@site1.com") ::
            ("title2", "content2", new URL("http://link2.com"), "author2@site2.com") ::
            Nil

val rss = (
        RssFeed("some title", new URL("http://someli.nk"), "some description")
            withWebMaster "somebody@somewhere.com"
            withItems (items map (item => RssItem
                withTitle item._1 
                withDescription item._2
                withLink item._3
                withAuthor item._4))).toXml

Validation at compilation

Code with no enough information to produce a valid RSS feed will not compile, for example the following code will not compile because an item must have a title or a description

val rss = (
        RssFeed("some title", new URL("http://someli.nk"), "some description")
            withItems (items map (item => RssItem // error
                withLink item._3
                withAuthor item._4))).toXml

About

Scala Syndication Utils - A Simple way to generate RSS feeds in Scala

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published