made a pubsubhub constant

This commit is contained in:
maxwell 2010-07-16 12:42:36 -07:00
parent 4160baa25e
commit 99f7e938fd
3 changed files with 7 additions and 5 deletions

View file

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

View file

@ -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
<link href="http://pubsubhubbub.appspot.com/" rel="hub"/>
<link href="#{APP_CONFIG[:pubsub_server]}" rel="hub"/>
XML
end

View file

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