Play framework template for RSS Subscribe Pub

Wanted to add RSS to my dinky geeky wiki/blog platform but couldn't find an already written play template for that, if you can believe it.

Well, didn't take too long and, after playing with some RSS validators whatnot, there now is one. Enjoy!

Note that XML templates are compiled in a views.xml... package instead of the usual views.html... package.

@(page:model.WikiEntry, items:List[model.UWID])<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
    <description>TODO feed description</description>

    @defining(org.joda.time.format.DateTimeFormat.forPattern("EEE, dd MMM yyyy HH:mm:ss Z")) {fmt=>
    @items.flatMap( isAfter _.crDtm).take(50).map {we=>
        <description>TODO description @we.crDtm</description>

** Note** leave the xml header in the first line, otherwise it gets hairy - that's some play framework weirding factor. Otherwise, using this play xml template is pretty simple:

      Ok(, linksTo(w)))

You can see it in action in this blog:

Also, if you need a geeky wiki blog like this one, get one (or a few) at


Was this useful?    

By: Razie | 2014-11-13 .. 2016-05-16 | Tags: post , scala , play , programming

See more in: Cool Scala Subscribe

Viewed 1273 times ( | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2021, all rights reserved.