-
-
Save MaxwellBo/11f57f150736d9e37efe19ba74556bdd to your computer and use it in GitHub Desktop.
Scala/Play RSS example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rss = Action { implicit request => | |
Ok( | |
<rss version="2.0"> | |
<channel> | |
<title>News Application</title> | |
<link>{ routes.Application.index.absoluteURL(false) }</link> | |
<description>News Application</description> | |
{ NewsArticle.all.map { newsArticle => | |
<item> | |
<title>{ newsArticle.title }</title> | |
<link>{ routes.News.article(newsArticle.id).absoluteURL(false) }</link> | |
<description>{ newsArticle.text }</description> | |
</item> | |
}} | |
</channel> | |
</rss> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment