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 +4 -4
- data/lib/ruboty/handlers/rss.rb +12 -9
- data/lib/ruboty/rss/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 488a0b4c2f41dc1e8eb62bf4a76f64f6fc1c2e31
|
4
|
+
data.tar.gz: 8870a49c7504189ee150d48e7de5cd5f42c9a16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 685bd3d96cbcb4c249f8f1dab8099ae8233b47b22759ecd6af37c94b09397c9fff28fca221603f8511b4546fc94f709dc3bc7a1b83e9f94d5a728399333586e2
|
7
|
+
data.tar.gz: a101485d49806391ae6e68889104da7c825b827465b4a99e4be2f613b0f2ac0a9989049b88666e5ed74df9d361dc404706473f0c016d79b8e2200187c451ca07
|
data/lib/ruboty/handlers/rss.rb
CHANGED
@@ -6,7 +6,7 @@ module Ruboty
|
|
6
6
|
DEFAULT_INTERVAL = 60 * 15
|
7
7
|
NAMESPACE = "rss"
|
8
8
|
|
9
|
-
on(/subscribe rss (?<
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
28
|
-
|
29
|
+
feeds[feed.id] = feed
|
30
|
+
feed_data[feed.id] = feed.attributes
|
31
|
+
end
|
29
32
|
|
30
|
-
message.reply("
|
33
|
+
message.reply("#{urls.size} feed(s) subscribed.")
|
31
34
|
end
|
32
35
|
|
33
36
|
def unsubscribe(message)
|
data/lib/ruboty/rss/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|