This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree 3 files changed +17
-2
lines changed 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ ruby '2.4.2'
4
4
5
5
gem 'idobata'
6
6
gem 'pry'
7
+ gem 'activesupport'
Original file line number Diff line number Diff line change 1
1
GEM
2
2
remote: https://rubygems.org/
3
3
specs:
4
+ activesupport (5.1.4 )
5
+ concurrent-ruby (~> 1.0 , >= 1.0.2 )
6
+ i18n (~> 0.7 )
7
+ minitest (~> 5.1 )
8
+ tzinfo (~> 1.1 )
4
9
coderay (1.1.0 )
10
+ concurrent-ruby (1.0.5 )
5
11
faraday (0.9.2 )
6
12
multipart-post (>= 1.2 , < 3 )
13
+ i18n (0.8.6 )
7
14
idobata (0.0.9 )
8
15
faraday (>= 0.8.8 )
9
16
method_source (0.8.2 )
17
+ minitest (5.10.3 )
10
18
multipart-post (2.0.0 )
11
19
pry (0.10.2 )
12
20
coderay (~> 1.1.0 )
13
21
method_source (~> 0.8.1 )
14
22
slop (~> 3.4 )
15
23
slop (3.6.0 )
24
+ thread_safe (0.3.6 )
25
+ tzinfo (1.2.3 )
26
+ thread_safe (~> 0.1 )
16
27
17
28
PLATFORMS
18
29
ruby
19
30
20
31
DEPENDENCIES
32
+ activesupport
21
33
idobata
22
34
pry
23
35
Original file line number Diff line number Diff line change 3
3
4
4
require 'rss'
5
5
require 'idobata'
6
+ require 'active_support/all'
6
7
require 'pry'
7
8
8
9
Idobata . hook_url = ENV [ 'IDOBATA_END' ]
18
19
19
20
# NOTE: Heroku Scheduler's frequency should be set to "Every 10 minutes"
20
21
articles = rss . items . select do |item |
21
- #(Time.now - item.published.content) / 60 <= 10000 # for debugging
22
- ( Time . now - item . published . content ) / 60 <= 10
22
+ # TODO: RSS object deletes timezone, so we need to recover it into JST
23
+ #(Time.now - (item.published.content - 9.hours)) / 60 <= 10000 # for debugging
24
+ ( Time . now - ( item . published . content - 9 . hours ) ) / 60 <= 10
23
25
end
24
26
25
27
msg << articles . map { |a |
You can’t perform that action at this time.
0 commit comments