mirror of
https://github.com/CodeforLeipzig/stadtratmonitor.git
synced 2024-12-22 23:53:15 +01:00
first version of RSS builder
This commit is contained in:
parent
06f5fc1bf5
commit
1b7d35a7b8
1 changed files with 18 additions and 0 deletions
18
app/views/search/index.rss.builder
Normal file
18
app/views/search/index.rss.builder
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
xml.instruct! :xml, :version => "1.0"
|
||||||
|
xml.rss :version => "2.0" do
|
||||||
|
xml.channel do
|
||||||
|
xml.title "Search results"
|
||||||
|
xml.description "Papers matching search criteria"
|
||||||
|
xml.link root_url
|
||||||
|
|
||||||
|
@papers.each do |doc|
|
||||||
|
xml.item do
|
||||||
|
xml.title doc.name
|
||||||
|
xml.description article.content[0, doc.content.length < 30 ? doc.content.length : 30]
|
||||||
|
xml.pubDate doc.published_at.to_date.to_s(:rfc822)
|
||||||
|
xml.link doc.url
|
||||||
|
xml.guid doc.url
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue