Module: Social2social::Models::Shareable::InstanceMethods

Defined in:
lib/social2social/models/shareable.rb

Instance Method Summary collapse

Instance Method Details

#init_feeds_to_hubObject



14
15
16
17
# File 'lib/social2social/models/shareable.rb', line 14

def init_feeds_to_hub
  publish_or_update_public_feed
  #TO-DO: add calls to other public feeds if any
end

#publish_or_update_public_feedObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/social2social/models/shareable.rb', line 19

def publish_or_update_public_feed
  t = Thread.new do
    hub = Social2social.hub 
    topic = Social2social.node_base_url+'/api/user/'+self.slug+'/public.atom'
    
    uri = URI.parse(hub)
    response = Net::HTTP::post_form(uri,{ 'hub.mode' => 'publish',
                                          'hub.url'  => topic})
    #TO-DO: process 4XX look at: response.status                                      
  end
end