IZ MS blogs ctivity streams/atom
This commit is contained in:
parent
0bafac9c26
commit
c124a9ab41
2 changed files with 21 additions and 3 deletions
|
|
@ -4,9 +4,10 @@ class BlogsController < ApplicationController
|
|||
def index
|
||||
@blogs = Blog.paginate :page => params[:page], :order => 'created_at DESC'
|
||||
|
||||
format.html
|
||||
format.atom {render :xml => Diaspora::XML::generate(:current_url => request.url, :objects => @bookmarks)}
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.atom {render :xml => Diaspora::XML::generate(:current_url => request.url, :objects => @blogs)}
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -188,6 +188,23 @@ module Diaspora
|
|||
XML
|
||||
end
|
||||
|
||||
|
||||
def self.Blog_build_entry(blog)
|
||||
<<-XML
|
||||
<entry>
|
||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||
<title>#{blog.title}</title>
|
||||
<content>#{blog.body}</content>
|
||||
<permalink>
|
||||
<link rel="alternate" type="text/html" href="#{OWNER.url}blogs/#{blog.id}"/>
|
||||
</permalink>
|
||||
<id>#{OWNER.url}blogs/#{blog.id}</id>
|
||||
<published>#{blog.created_at.xmlschema}</published>
|
||||
<updated>#{blog.updated_at.xmlschema}</updated>
|
||||
</entry>
|
||||
XML
|
||||
end
|
||||
|
||||
def self.footer
|
||||
<<-XML.strip
|
||||
</feed>
|
||||
|
|
|
|||
Loading…
Reference in a new issue