From 081a6a2c7385a21232234b902efaa758b34a7c41 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 10:39:02 -0700 Subject: [PATCH 01/27] MS IZ trying to delete commented stuff --- app/views/publics/webfinger.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/publics/webfinger.erb b/app/views/publics/webfinger.erb index e2f20467f..4fbd177cf 100644 --- a/app/views/publics/webfinger.erb +++ b/app/views/publics/webfinger.erb @@ -4,7 +4,7 @@ http://www.identi.ca/user/169966 - - + + From 172141db0a4af7c6ac14f5d8054d0a4194ccaa1f Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:07:17 -0700 Subject: [PATCH 02/27] IZ MS setting alias to not idendica --- app/views/publics/webfinger.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/publics/webfinger.erb b/app/views/publics/webfinger.erb index 4fbd177cf..88e5fd9aa 100644 --- a/app/views/publics/webfinger.erb +++ b/app/views/publics/webfinger.erb @@ -1,7 +1,7 @@ acct:<%=@user.email%> - http://www.identi.ca/user/169966 + "<%=@user.url%>hcard" From 4259dc7dfe1c0e8b02760fcc1b7d38b067db2bbe Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:10:38 -0700 Subject: [PATCH 03/27] IZ MS changing end slash --- app/views/publics/host_meta.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/publics/host_meta.erb b/app/views/publics/host_meta.erb index 3b6280e5c..9aa544278 100644 --- a/app/views/publics/host_meta.erb +++ b/app/views/publics/host_meta.erb @@ -3,7 +3,7 @@ xmlns:hm='http://host-meta.net/xrd/1.0'> <%=@user.url%> + template='<%=@user.url%>webfinger?q={uri}'> Resource Descriptor From 7e190047ec52005c5a826d005bccf68a294eaa8d Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:14:26 -0700 Subject: [PATCH 04/27] IZ MS host --- app/views/publics/host_meta.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/publics/host_meta.erb b/app/views/publics/host_meta.erb index 9aa544278..33112533c 100644 --- a/app/views/publics/host_meta.erb +++ b/app/views/publics/host_meta.erb @@ -1,7 +1,7 @@ - <%=@user.url%> + washington.joindiaspora.com Resource Descriptor From d2dea48fe65a26447eb7373a8a1ed0af2cb0015a Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:26:16 -0700 Subject: [PATCH 05/27] MS IZ added .atom so we may publish correctly --- lib/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index 652e140b5..650f053c9 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -62,7 +62,7 @@ module Diaspora xml = self.class.build_xml_for([self]) @@queue.add_post_request( recipients, xml ) - @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish/', User.owner.url + self.class.to_s.pluralize.underscore ) + @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish/', User.owner.url + self.class.to_s.pluralize.underscore +'.atom' ) @@queue.process end From 398e104296343dd84ffdf613474e8aa8b0dc35da Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:32:40 -0700 Subject: [PATCH 06/27] MS IZ TYPO forgot a space --- lib/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index 650f053c9..38d132bc0 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -62,7 +62,7 @@ module Diaspora xml = self.class.build_xml_for([self]) @@queue.add_post_request( recipients, xml ) - @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish/', User.owner.url + self.class.to_s.pluralize.underscore +'.atom' ) + @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom' ) @@queue.process end From e7484a3a94df6ae41391aa3c71791ad443e3db75 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:38:04 -0700 Subject: [PATCH 07/27] MS IZ TYPO deleteing trailing slash from publisher endpoint --- lib/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index 38d132bc0..437b27f23 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -62,7 +62,7 @@ module Diaspora xml = self.class.build_xml_for([self]) @@queue.add_post_request( recipients, xml ) - @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom' ) + @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish', User.owner.url + self.class.to_s.pluralize.underscore + '.atom' ) @@queue.process end From 8c2dcb58c7dfd8ba26d85d643e636db88f351742 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:43:02 -0700 Subject: [PATCH 08/27] MS IZ TYPO deleteing trailing slash from atom --- lib/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index 437b27f23..421bee9cf 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -62,7 +62,7 @@ module Diaspora xml = self.class.build_xml_for([self]) @@queue.add_post_request( recipients, xml ) - @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish', User.owner.url + self.class.to_s.pluralize.underscore + '.atom' ) + @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish', User.owner.url + self.class.to_s.pluralize.underscore ) @@queue.process end From 566cceb03fa5e0968753e4553e196e3e3305a636 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:46:46 -0700 Subject: [PATCH 09/27] MS IZ TYPO try deleteing publish --- lib/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index 421bee9cf..6a957ac4c 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -62,7 +62,7 @@ module Diaspora xml = self.class.build_xml_for([self]) @@queue.add_post_request( recipients, xml ) - @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/publish', User.owner.url + self.class.to_s.pluralize.underscore ) + @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom') @@queue.process end From ef19322ef6ccbab89f4c74a0848b8263a8c54bbe Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:51:13 -0700 Subject: [PATCH 10/27] IZ MS debugging info on publish..... --- lib/message_handler.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 95c6eb650..ad39d746a 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -18,6 +18,7 @@ class MessageHandler end def add_hub_notification(destination, feed_location) + puts "going to: #{destination}, telling it to fetch #{feed_location}" @queue.push(Message.new(:pubhub, destination, feed_location)) end @@ -32,7 +33,7 @@ class MessageHandler http.callback {send_to_seed(query, http.response); process} when :pubhub http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT - http.callback { puts "boner city" + http.response ; process} + http.callback { puts "boner city"; process} else raise "message is not a type I know!" end From 6a728f7b5044adcb5035c3ef197a6a2ba6846012 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:54:06 -0700 Subject: [PATCH 11/27] IZ MS debugging info on publish..... --- lib/common.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index 6a957ac4c..4d0d11a00 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -57,12 +57,14 @@ module Diaspora end def push_to(recipients) + + @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom') + unless recipients.empty? recipients.map!{|x| x = x.url + "receive/"} xml = self.class.build_xml_for([self]) @@queue.add_post_request( recipients, xml ) - @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom') @@queue.process end From 4160baa25ea92850e5a5d26188a7d398411f8d03 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 11:55:36 -0700 Subject: [PATCH 12/27] process always now --- lib/common.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index 4d0d11a00..111db5f26 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -64,10 +64,8 @@ module Diaspora recipients.map!{|x| x = x.url + "receive/"} xml = self.class.build_xml_for([self]) @@queue.add_post_request( recipients, xml ) - - - @@queue.process end + @@queue.process end def push_to_url(url) From 99f7e938fdfde625e47390e6cd510962bbb10a75 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 12:42:36 -0700 Subject: [PATCH 13/27] made a pubsubhub constant --- config/app_config.yml | 3 +++ lib/common.rb | 4 ++-- lib/message_handler.rb | 5 ++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/app_config.yml b/config/app_config.yml index 526feac11..0c87b6b4c 100644 --- a/config/app_config.yml +++ b/config/app_config.yml @@ -1,11 +1,14 @@ development: debug: false socket_port: 8080 + pubsub_server: 'https://pubsubhubbub.appspot.com/' test: debug: false socket_port: 8081 + pubsub_server: 'https://pubsubhubbub.appspot.com/' production: debug: false socket_port: 8080 + pubsub_server: 'https://pubsubhubbub.appspot.com/' diff --git a/lib/common.rb b/lib/common.rb index 111db5f26..8e5732610 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -58,7 +58,7 @@ module Diaspora def push_to(recipients) - @@queue.add_hub_notification('http://pubsubhubbub.appspot.com/', User.owner.url + self.class.to_s.pluralize.underscore + '.atom') + @@queue.add_hub_notification(APP_CONFIG[:pubsub_server], User.owner.url + self.class.to_s.pluralize.underscore + '.atom') unless recipients.empty? recipients.map!{|x| x = x.url + "receive/"} @@ -132,7 +132,7 @@ module Diaspora def self.endpoints <<-XML - + XML end diff --git a/lib/message_handler.rb b/lib/message_handler.rb index ad39d746a..641627383 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -2,7 +2,7 @@ class MessageHandler NUM_TRIES = 3 TIMEOUT = 5 #seconds - + def initialize @queue = EM::Queue.new end @@ -18,7 +18,6 @@ class MessageHandler end def add_hub_notification(destination, feed_location) - puts "going to: #{destination}, telling it to fetch #{feed_location}" @queue.push(Message.new(:pubhub, destination, feed_location)) end @@ -33,7 +32,7 @@ class MessageHandler http.callback {send_to_seed(query, http.response); process} when :pubhub http = EventMachine::PubSubHubbub.new(query.destination).publish query.body, :timeout => TIMEOUT - http.callback { puts "boner city"; process} + http.callback { process} else raise "message is not a type I know!" end From 3d87c111df2803df8e63af67003fb05122136a9c Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:15:19 -0700 Subject: [PATCH 14/27] webfinger is now not washington specific --- app/models/user.rb | 7 +++++++ app/views/publics/host_meta.erb | 2 +- spec/models/user_spec.rb | 6 ++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index edb80a5db..beb4f1f6c 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -80,6 +80,13 @@ class User < Person def mine?(post) self == post.person end + + def terse_url + terse= self.url.gsub(/https?:\/\//, '') + terse.gsub!(/www\./, '') + terse = terse.chop! if terse[-1, 1] == '/' + terse + end def do_bad_things self.password_confirmation = self.password diff --git a/app/views/publics/host_meta.erb b/app/views/publics/host_meta.erb index 33112533c..53d8aeba4 100644 --- a/app/views/publics/host_meta.erb +++ b/app/views/publics/host_meta.erb @@ -1,7 +1,7 @@ - washington.joindiaspora.com + <%= @user.terse_url %> Resource Descriptor diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8c0f1cf7b..854cde20b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -41,4 +41,10 @@ describe User do @user.send_friend_request_to( @friend.url ).should be nil end + + it 'should be able to give me the terse url for webfinger' do + user = Factory.create(:user) + user.terse_url.should == 'example.com' + end + end From 03a8f2ea5c5581ccfed0794053d09f86bc574437 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:36:50 -0700 Subject: [PATCH 15/27] trying to get it reporting from diaspora --- app/views/publics/webfinger.erb | 3 --- lib/common.rb | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/app/views/publics/webfinger.erb b/app/views/publics/webfinger.erb index 88e5fd9aa..8ad41e0e7 100644 --- a/app/views/publics/webfinger.erb +++ b/app/views/publics/webfinger.erb @@ -5,6 +5,3 @@ - - - diff --git a/lib/common.rb b/lib/common.rb index 8e5732610..5242d9d8c 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -113,7 +113,7 @@ module Diaspora <<-XML -Diaspora +Diaspora #{current_url} Stream its a stream From 183e0c4b5a54540f86e44ddcaeb03df1569db357 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:40:28 -0700 Subject: [PATCH 16/27] trying to get it reporting from diaspora --- lib/common.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index 5242d9d8c..cf15de014 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -140,9 +140,9 @@ module Diaspora <<-XML http://activitystrea.ms/schema/1.0/person -#{OWNER.url} +#{OWNER.url}/hcard #{OWNER.real_name} - + XML end From 13b4fab6ae769be7d2f8818aad16801b1c263db2 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:43:01 -0700 Subject: [PATCH 17/27] trying to get it reporting from diaspora --- lib/common.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index cf15de014..3c7811387 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -140,9 +140,9 @@ module Diaspora <<-XML http://activitystrea.ms/schema/1.0/person -#{OWNER.url}/hcard +#{OWNER.url}hcard #{OWNER.real_name} - + XML end From df447ba7c093d566d44e8f94214fd4c9b6381689 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:44:26 -0700 Subject: [PATCH 18/27] trying to get it reporting from diaspora --- lib/common.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index 3c7811387..5242d9d8c 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -140,9 +140,9 @@ module Diaspora <<-XML http://activitystrea.ms/schema/1.0/person -#{OWNER.url}hcard +#{OWNER.url} #{OWNER.real_name} - + XML end From 7be469f928bda3cd7193faec463fb16161309b3d Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:45:18 -0700 Subject: [PATCH 19/27] trying to get it reporting from diaspora --- lib/common.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index 5242d9d8c..862cb1004 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -113,7 +113,7 @@ module Diaspora <<-XML -Diaspora +Diaspora #{current_url} Stream its a stream @@ -142,7 +142,7 @@ module Diaspora http://activitystrea.ms/schema/1.0/person #{OWNER.url} #{OWNER.real_name} - + XML end From 642db5006fbb4b208fafe42c4379e4a1e0f6566f Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:49:44 -0700 Subject: [PATCH 20/27] trying to get it reporting from diaspora --- app/views/publics/hcard.erb | 4 ++-- lib/common.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index e544a8592..6df2462bb 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -13,7 +13,7 @@
Nickname
- <%= @user.real_name%> + <%= @user.real_name%>
@@ -25,7 +25,7 @@
URL
- <%= @user.url%> + <%= @user.url%>
diff --git a/lib/common.rb b/lib/common.rb index 862cb1004..27db0866b 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -142,7 +142,7 @@ module Diaspora http://activitystrea.ms/schema/1.0/person #{OWNER.url} #{OWNER.real_name} - + XML end From 86718dbec3ebacdaa05ee882d995d968e2edd928 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:53:07 -0700 Subject: [PATCH 21/27] trying to get it reporting from diaspora --- app/views/publics/hcard.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index 6df2462bb..e544a8592 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -13,7 +13,7 @@
Nickname
- <%= @user.real_name%> + <%= @user.real_name%>
@@ -25,7 +25,7 @@
URL
- <%= @user.url%> + <%= @user.url%>
From 98bc75462727363207153757883c4027fd6e8631 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 14:54:14 -0700 Subject: [PATCH 22/27] trying to get it reporting from diaspora --- app/views/publics/hcard.erb | 45 +++++++++++++++---------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index e544a8592..34f88866e 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -1,39 +1,30 @@ - -
-
- -
-

<%=@user.real_name%>

-
-
-

User profile

-
+
+

<%=@user.real_name%>

+
+
+

User profile

+
Nickname
<%= @user.real_name%> -
-
-
+ +
+
Full name
<%= @user.real_name %> -
-
-
+ +
+
URL
<%= @user.url%> -
-
-
+ +
+
Note
Diaspora is awesome! vi is better than emacs!
-
+
+
+
-
-
- - From 06238703c3ceb81ea9665e5ca3ab3d59534ce977 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 15:54:26 -0700 Subject: [PATCH 23/27] IZ MS bookmarks now create activity streams --- app/controllers/blogs_controller.rb | 6 ++++++ app/controllers/bookmarks_controller.rb | 6 ++++++ lib/common.rb | 15 +++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index 27a5c8690..5bc4a5355 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb @@ -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 diff --git a/app/controllers/bookmarks_controller.rb b/app/controllers/bookmarks_controller.rb index 2f62d5cd3..1c7b8d986 100644 --- a/app/controllers/bookmarks_controller.rb +++ b/app/controllers/bookmarks_controller.rb @@ -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 diff --git a/lib/common.rb b/lib/common.rb index 27db0866b..e494e7e88 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -164,6 +164,7 @@ module Diaspora def self.StatusMessage_build_entry(status_message) <<-XML +http://activitystrea.ms/schema/1.0/post #{status_message.message} #{OWNER.url}status_messages/#{status_message.id} @@ -173,6 +174,20 @@ module Diaspora XML end + def self.Bookmark_build_entry(bookmark) + <<-XML + +http://activitystrea.ms/schema/1.0/post +#{bookmark.title} + +#{OWNER.url}bookmarks/#{bookmark.id} +#{bookmark.created_at.xmlschema} +#{bookmark.updated_at.xmlschema} + + XML + end + def self.footer <<-XML.strip From 0bafac9c26eb088f4c2ac2474ff488e2487b266a Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 15:58:58 -0700 Subject: [PATCH 24/27] IZ MS bookmarks now create VALID activity streams/atom --- lib/common.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.rb b/lib/common.rb index e494e7e88..d4a9b8cd9 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -180,7 +180,7 @@ module Diaspora http://activitystrea.ms/schema/1.0/post #{bookmark.title} - #{OWNER.url}bookmarks/#{bookmark.id} #{bookmark.created_at.xmlschema} #{bookmark.updated_at.xmlschema} From c124a9ab41bb25efcf5525a649f5909b10b5080b Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 16:07:58 -0700 Subject: [PATCH 25/27] IZ MS blogs ctivity streams/atom --- app/controllers/blogs_controller.rb | 7 ++++--- lib/common.rb | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index 5bc4a5355..4a548de06 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb @@ -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 diff --git a/lib/common.rb b/lib/common.rb index d4a9b8cd9..db626a963 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -188,6 +188,23 @@ module Diaspora XML end + + def self.Blog_build_entry(blog) + <<-XML + +http://activitystrea.ms/schema/1.0/post +#{blog.title} +#{blog.body} + + + +#{OWNER.url}blogs/#{blog.id} +#{blog.created_at.xmlschema} +#{blog.updated_at.xmlschema} + + XML + end + def self.footer <<-XML.strip From e0284b28ee90230c244541c4a7624ed2abd89337 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 16:15:59 -0700 Subject: [PATCH 26/27] IZ MS blogs ctivity streams/atom --- lib/common.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index db626a963..38189e325 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -195,9 +195,7 @@ module Diaspora http://activitystrea.ms/schema/1.0/post #{blog.title} #{blog.body} - - #{OWNER.url}blogs/#{blog.id} #{blog.created_at.xmlschema} #{blog.updated_at.xmlschema} From b3bb9f8da2de544a90f0734f2204c265b9f4552b Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 16 Jul 2010 17:00:54 -0700 Subject: [PATCH 27/27] IZ MS fixed user being a constant in the lib which causes a bug when db is reseeded --- lib/common.rb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/common.rb b/lib/common.rb index 38189e325..f2fb5c29a 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -97,8 +97,6 @@ module Diaspora module XML - OWNER = User.owner - def self.generate(opts= {}) xml = Generate::headers(opts[:current_url]) xml << Generate::author @@ -110,6 +108,8 @@ module Diaspora module Generate def self.headers(current_url) + #this is retarded + @@user = User.owner <<-XML @@ -124,8 +124,8 @@ module Diaspora def self.author <<-XML -#{OWNER.real_name} -#{OWNER.url} +#{@@user.real_name} +#{@@user.url} XML end @@ -140,9 +140,9 @@ module Diaspora <<-XML http://activitystrea.ms/schema/1.0/person -#{OWNER.url} -#{OWNER.real_name} - +#{@@user.url} +#{@@user.real_name} + XML end @@ -166,8 +166,8 @@ module Diaspora http://activitystrea.ms/schema/1.0/post #{status_message.message} - -#{OWNER.url}status_messages/#{status_message.id} + +#{@@user.url}status_messages/#{status_message.id} #{status_message.created_at.xmlschema} #{status_message.updated_at.xmlschema} @@ -179,9 +179,9 @@ module Diaspora http://activitystrea.ms/schema/1.0/post #{bookmark.title} - + -#{OWNER.url}bookmarks/#{bookmark.id} +#{@@user.url}bookmarks/#{bookmark.id} #{bookmark.created_at.xmlschema} #{bookmark.updated_at.xmlschema} @@ -195,8 +195,8 @@ module Diaspora http://activitystrea.ms/schema/1.0/post #{blog.title} #{blog.body} - -#{OWNER.url}blogs/#{blog.id} + +#{@@user.url}blogs/#{blog.id} #{blog.created_at.xmlschema} #{blog.updated_at.xmlschema}