ruboty-rss 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc0bfe9c6b86306b08df1b8f0351a1803fa8fbca
4
- data.tar.gz: 716eb30882bdd60839618eae6fbfe6f3909e74ac
3
+ metadata.gz: 488a0b4c2f41dc1e8eb62bf4a76f64f6fc1c2e31
4
+ data.tar.gz: 8870a49c7504189ee150d48e7de5cd5f42c9a16d
5
5
  SHA512:
6
- metadata.gz: 45749c3e7dd95afff7d71bc8fb6951a8a7bcd9fd235b1c27bc5c6a2e2cc871e83b877bd7fa9759876c5ddaffac9ca56c11c352d1306fce70cf49076eb85f648b
7
- data.tar.gz: 67acde9f609871a400a2101d43adf2f6fcbc5e81a2f15ff76f65f34ccd52fc56a3c7bedfa6f1669773d58fbfb84368bd95e0a6dc5078c4bb17b229d8fba05f93
6
+ metadata.gz: 685bd3d96cbcb4c249f8f1dab8099ae8233b47b22759ecd6af37c94b09397c9fff28fca221603f8511b4546fc94f709dc3bc7a1b83e9f94d5a728399333586e2
7
+ data.tar.gz: a101485d49806391ae6e68889104da7c825b827465b4a99e4be2f613b0f2ac0a9989049b88666e5ed74df9d361dc404706473f0c016d79b8e2200187c451ca07
@@ -6,7 +6,7 @@ module Ruboty
6
6
  DEFAULT_INTERVAL = 60 * 15
7
7
  NAMESPACE = "rss"
8
8
 
9
- on(/subscribe rss (?<url>.+)/, name: "subscribe", description: "Subscribe a new RSS feed")
9
+ on(/subscribe rss (?<urls>.+)/, name: "subscribe", description: "Subscribe a new RSS feed (multiple urls with ',' separator)")
10
10
  on(/unsubscribe rss (?<id>.+)/, name: "unsubscribe", description: "Unsubscribe a new RSS feed")
11
11
  on(/list rss feeds/, name: "list", description: "List watching RSS feeds")
12
12
 
@@ -17,17 +17,20 @@ module Ruboty
17
17
  end
18
18
 
19
19
  def subscribe(message)
20
- feed = Ruboty::Rss::Feed.new(
21
- message.original.except(:robot).merge(
22
- id: generate_id,
23
- url: message[:url],
20
+ urls = message[:urls].split(',')
21
+ urls.each do |url|
22
+ feed = Ruboty::Rss::Feed.new(
23
+ message.original.except(:robot).merge(
24
+ id: generate_id,
25
+ url: url,
26
+ )
24
27
  )
25
- )
26
28
 
27
- feeds[feed.id] = feed
28
- feed_data[feed.id] = feed.attributes
29
+ feeds[feed.id] = feed
30
+ feed_data[feed.id] = feed.attributes
31
+ end
29
32
 
30
- message.reply("Subscribed.")
33
+ message.reply("#{urls.size} feed(s) subscribed.")
31
34
  end
32
35
 
33
36
  def unsubscribe(message)
@@ -1,5 +1,5 @@
1
1
  module Ruboty
2
2
  module Rss
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-rss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-02 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport