octopus 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
@@ -25,8 +25,8 @@ module Grabbers
25
25
  http.callback{ |response|
26
26
  resource.set_next_update
27
27
  if resource_changed?(resource, response)
28
- notify_subscribers(resource)
29
28
  update_changed_resource(resource, response)
29
+ notify_subscribers(resource)
30
30
  end
31
31
  }
32
32
  http.errback {|response|
@@ -37,13 +37,15 @@ module Grabbers
37
37
  end
38
38
 
39
39
  # Notifies each of a NetResource's subscribers that the resource has changed
40
- # by doing an HTTP GET request to the subscriber's callback url.
40
+ # by doing an HTTP POST request to the subscriber's callback url.
41
+ #
42
+ # The POST body contains a key called "data" which contains the feed value.
41
43
  #
42
44
  def notify_subscribers(resource)
43
45
  resource.subscriptions.each do |subscription|
44
46
  http = EM::HttpRequest.new(subscription.url).post(:body => {:data => resource.body})
45
47
  http.callback{ |response|
46
- puts "found updated data for #{resource.url}, #{resource.body.length} characters"
48
+ puts "POSTed updated data for #{resource.url}, #{resource.body.length} characters"
47
49
  }
48
50
  http.errback {|response|
49
51
  # Do something here, maybe setting the resource
data/octopus.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{octopus}
8
- s.version = "0.0.8"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["dave@boomer"]
12
- s.date = %q{2010-12-09}
12
+ s.date = %q{2010-12-27}
13
13
  s.default_executable = %q{octopus}
14
14
  s.description = %q{Grabs stuff off the net and notifies interested subscribers.}
15
15
  s.email = %q{dave.hrycyszyn@headlondon.com}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopus
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - dave@boomer
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-09 00:00:00 +00:00
18
+ date: 2010-12-27 00:00:00 +00:00
19
19
  default_executable: octopus
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency