IZ MS bookmarks now create activity streams
This commit is contained in:
parent
98bc754627
commit
06238703c3
3 changed files with 27 additions and 0 deletions
|
|
@ -3,6 +3,12 @@ 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)}
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
|||
|
|
@ -4,6 +4,12 @@ class BookmarksController < ApplicationController
|
|||
def index
|
||||
@bookmark = Bookmark.new
|
||||
@bookmarks = Bookmark.paginate :page => params[:page], :order => 'created_at DESC'
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.atom {render :xml => Diaspora::XML::generate(:current_url => request.url, :objects => @bookmarks)}
|
||||
end
|
||||
end
|
||||
|
||||
def edit
|
||||
|
|
|
|||
|
|
@ -164,6 +164,7 @@ module Diaspora
|
|||
def self.StatusMessage_build_entry(status_message)
|
||||
<<-XML
|
||||
<entry>
|
||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||
<title>#{status_message.message}</title>
|
||||
<link rel="alternate" type="text/html" href="#{OWNER.url}status_messages/#{status_message.id}"/>
|
||||
<id>#{OWNER.url}status_messages/#{status_message.id}</id>
|
||||
|
|
@ -173,6 +174,20 @@ module Diaspora
|
|||
XML
|
||||
end
|
||||
|
||||
def self.Bookmark_build_entry(bookmark)
|
||||
<<-XML
|
||||
<entry>
|
||||
<activity:verb>http://activitystrea.ms/schema/1.0/post</activity:verb>
|
||||
<title>#{bookmark.title}</title>
|
||||
<link rel="alternate" type="text/html" href="#{OWNER.url}bookmarks/#{bookmark.id}"/>
|
||||
<link rel="related" type="text/html" href="#{bookmark.link}"
|
||||
<id>#{OWNER.url}bookmarks/#{bookmark.id}</id>
|
||||
<published>#{bookmark.created_at.xmlschema}</published>
|
||||
<updated>#{bookmark.updated_at.xmlschema}</updated>
|
||||
</entry>
|
||||
XML
|
||||
end
|
||||
|
||||
def self.footer
|
||||
<<-XML.strip
|
||||
</feed>
|
||||
|
|
|
|||
Loading…
Reference in a new issue