OSDN Git Service

merge v06sheet
[pettanr/pettanr.git] / app / views / scrolls / index.atom.builder
diff --git a/app/views/scrolls/index.atom.builder b/app/views/scrolls/index.atom.builder
new file mode 100644 (file)
index 0000000..a1e9b0c
--- /dev/null
@@ -0,0 +1,25 @@
+atom_feed(
+  :language => 'ja-JP',
+  :root_url => root_url,
+  :url => root_url(:format => :atom),
+  :id => root_url
+) do |feed|
+  feed.title MagicNumber['profile']['users']['caption']
+  feed.subtitle sanitize(MagicNumber['profile']['users']['description'], :tags => %w(a p img br))
+  feed.updated Time.now
+  feed.author {|author| author.name(MagicNumber['profile']['web_master'])}
+
+  @comics.each do |comic|
+    feed.entry(
+      comic,
+      :url => comic_url(comic),
+      :id => comic_url(comic),
+      :published => comic.updated_at,
+      :updated => comic.updated_at
+    ) do |item|
+      item.title(comic.title)
+      item.content(comic.description, :type => 'html')
+      item.author {|author| author.name(comic.author.name)}
+    end
+  end
+end