diff options
| author | hukl <contact@smyck.org> | 2009-09-10 16:01:41 +0200 |
|---|---|---|
| committer | hukl <contact@smyck.org> | 2009-09-10 16:01:41 +0200 |
| commit | d7ec763c7ce069824aad24a6bd0d845ee74ed10d (patch) | |
| tree | 5def39dc36d468d190a072db2a089b7e8f12bd6a /app/views/rss | |
| parent | 304ba222fb85178763746ded4c1d252124c9ddfd (diff) | |
added public rss controller plus template to render the latest 20 updates into a neat little atom feed
Diffstat (limited to 'app/views/rss')
| -rw-r--r-- | app/views/rss/updates.xml.builder | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/views/rss/updates.xml.builder b/app/views/rss/updates.xml.builder new file mode 100644 index 0000000..541ad4e --- /dev/null +++ b/app/views/rss/updates.xml.builder | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | xml.instruct! | ||
| 2 | xml.feed(:xmlns => "http://www.w3.org/2005/Atom") do | ||
| 3 | xml.title("Chaos Computer Club Updates") | ||
| 4 | xml.link(:href => "http://www.ccc.de/") | ||
| 5 | xml.updated(@items.first.published_at) | ||
| 6 | xml.author("Chaos Computer Club e.V.") | ||
| 7 | xml.id("http://www.ccc.de/") | ||
| 8 | |||
| 9 | @items.each do |item| | ||
| 10 | xml.entry do | ||
| 11 | xml.title(item.title) | ||
| 12 | port = (request.port != 80) ? port = ":#{request.port}" : "" | ||
| 13 | xml.link(request.protocol + request.host + port + item.public_link) | ||
| 14 | xml.id(request.protocol + request.host + port + item.public_link) | ||
| 15 | xml.updated(item.updated_at) | ||
| 16 | xml.content(:type => "xhtml") do | ||
| 17 | xml.div(item.body, :xmlns => "http://www.w3.org/1999/xhtml") | ||
| 18 | end | ||
| 19 | end | ||
| 20 | |||
| 21 | end | ||
| 22 | |||
| 23 | end \ No newline at end of file | ||
