IZ MS bookmarks now create activity streams

This commit is contained in:
maxwell 2010-07-16 15:54:26 -07:00
parent 98bc754627
commit 06238703c3
3 changed files with 27 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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>