xml.instruct!
# RSS2 rxml template based on:
http://snippets.dzone.com/posts/show/558xml.rss "version" => "2.0", \
"xmlns:dc" => "http://purl.org/dc/elements/1.1/", \
"xmlns:media" => "http://search.yahoo.com/mrss/" do
xml.channel do
xml.title "foto-foo :: public timeline"
xml.link url_for :only_path => false, :controller => 'feeds'
xml.pubDate CGI.rfc1123_date(@images.first.updated_at) if @images.any?
xml.description "foto-foo :: public timeline image feed"
host = "AWS.S3.storage.host"
@images.each do |img|
img.url = "http://#{host}/#{img.name}"
xml.item do
xml.title img.name
xml.link url_for :only_path => false, :controller => 'feeds', :action => 'show', :id => img.id
xml.description "<a href='#{img.url}'><img src='#{img.url}'/></a>"
xml.enclosure :url => "#{img.url}", :type => "image/jpg"
xml.pubDate CGI.rfc1123_date img.updated_at
xml.guid url_for :only_path => false, :controller => 'posts', :action => 'show', :id => img.id
xml.author "\"user-#{img.user_id}\" (#{img.user_id}@foto-foo.com)"
xml.media :group do
xml.media :title, img.name
xml.media \
:content, :type => "#{img.mime}", :medium => "image", \
:url => "#{img.url}"
xml.media :credit, "#{img.credit.txt}", \
:role => "#{img.credit.role}"
xml.media :description, "#{img.desc}", :type => 'plain'
xml.media :keywords, "#{img.tags}"
xml.media :thumbnail, \
:width => "#{img.thumbnail.widh}", \
:height => "#{img.thumbnail.height}", \
:url => "#{img.thumbnail.url}"
end
end
end
end
end