asakusa-rss-monitor 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +34 -3
- data/lib/asakusa-rss-monitor.rb +6 -2
- data/lib/asakusa-rss-monitor/version.rb +1 -1
- metadata +1 -3
- data/sample/qa-checker.txt +0 -1
- data/sample/qa-monitor.rb +0 -26
data/README.md
CHANGED
@@ -1,4 +1,35 @@
|
|
1
|
-
asakusa-rss-monitor
|
2
|
-
|
1
|
+
# asakusa-rss-monitor
|
2
|
+
To post rss updates on AsakusaSatellite.
|
3
3
|
|
4
|
-
|
4
|
+
## Installation
|
5
|
+
gem install asakusa-rss-monitor
|
6
|
+
|
7
|
+
## Basic Usage
|
8
|
+
monitor = AsakusaRssMonitor.new({
|
9
|
+
:check_file => 'last_time.txt',
|
10
|
+
:rss_url => '<TARGET RSS>',
|
11
|
+
:as_info => AsakusaRssMonitor::ASInfo.new({
|
12
|
+
:api_key => '<YOUR AS API KEY>',
|
13
|
+
:entry_point => '<YOUR AS ENTRY POINT>', # cf. 'http://localhost:3000/api/v1'
|
14
|
+
:room_id => '<ROOM ID>'
|
15
|
+
})
|
16
|
+
})
|
17
|
+
monitor.call
|
18
|
+
|
19
|
+
## Post Message Customizing
|
20
|
+
class CustomMonitor < AsakusaRssMonitor::RssMonitor
|
21
|
+
def initialize(config)
|
22
|
+
super(config)
|
23
|
+
end
|
24
|
+
|
25
|
+
# override this.
|
26
|
+
def perform(rss_entry)
|
27
|
+
"New Article. - #{rss_entry.date}\n#{rss_entry.title}\n#{rss_entry.link}"
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
## Monitoring RSS
|
32
|
+
To monitoring rss, you can use this script with cron.
|
33
|
+
|
34
|
+
## Milestone
|
35
|
+
* spec..
|
data/lib/asakusa-rss-monitor.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require "asakusa-rss-monitor/version"
|
3
|
-
require "asakusa-rss-monitor/rss-monitor"
|
4
2
|
require "asakusa-rss-monitor/as-info"
|
3
|
+
require "asakusa-rss-monitor/date-save"
|
4
|
+
require "asakusa-rss-monitor/date-checker"
|
5
|
+
require "asakusa-rss-monitor/post-bot"
|
6
|
+
require "asakusa-rss-monitor/rss-getter"
|
7
|
+
require "asakusa-rss-monitor/rss-monitor"
|
8
|
+
require "asakusa-rss-monitor/version"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asakusa-rss-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -33,8 +33,6 @@ files:
|
|
33
33
|
- lib/asakusa-rss-monitor/rss-getter.rb
|
34
34
|
- lib/asakusa-rss-monitor/rss-monitor.rb
|
35
35
|
- lib/asakusa-rss-monitor/version.rb
|
36
|
-
- sample/qa-checker.txt
|
37
|
-
- sample/qa-monitor.rb
|
38
36
|
has_rdoc: true
|
39
37
|
homepage: https://github.com/3100/asakusa-rss-monitor
|
40
38
|
licenses: []
|
data/sample/qa-checker.txt
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Fri, 18 Jan 2013 15:24:56 +0900
|
data/sample/qa-monitor.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
#/usr/bin/ruby
|
3
|
-
|
4
|
-
require 'asakusa-rss-monitor'
|
5
|
-
|
6
|
-
class QaMonitor < AsakusaRssMonitor::RssMonitor
|
7
|
-
def initialize(config)
|
8
|
-
super(config)
|
9
|
-
end
|
10
|
-
|
11
|
-
def perform(rss_entry)
|
12
|
-
"新着の質問がありました。 - #{rss_entry.date}\n#{rss_entry.title}\n #{rss_entry.link} "
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
monitor = QaMonitor.new({
|
17
|
-
:check_file => 'qa-checker.txt',
|
18
|
-
:rss_url => 'http://localhost/?type=rss',
|
19
|
-
:as_info => AsakusaRssMonitor::ASInfo.new({
|
20
|
-
:api_key => ENV['AS_API'],
|
21
|
-
:entry_point => ENV['ENTRY_POINT'],
|
22
|
-
:room_id => '<target-room-id>'
|
23
|
-
})
|
24
|
-
})
|
25
|
-
monitor.call
|
26
|
-
|