consadole_aggregator 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/consadole_aggregator.gemspec +1 -1
- data/lib/consadole_aggregator/news.rb +7 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
@@ -9,6 +9,10 @@ require 'nokogiri'
|
|
9
9
|
|
10
10
|
module ConsadoleAggregator
|
11
11
|
module Aggregatable
|
12
|
+
def initialize logger=nil
|
13
|
+
@logger = logger || Logger.new(nil)
|
14
|
+
end
|
15
|
+
|
12
16
|
def get_new_articles
|
13
17
|
get_resource = self.class.get_resource
|
14
18
|
parse_list = self.class.parse_list
|
@@ -23,6 +27,7 @@ module ConsadoleAggregator
|
|
23
27
|
end
|
24
28
|
|
25
29
|
def update
|
30
|
+
@logger.info('begin of update')
|
26
31
|
get_new_articles.each do |article|
|
27
32
|
begin
|
28
33
|
yield article if block_given?
|
@@ -32,6 +37,7 @@ module ConsadoleAggregator
|
|
32
37
|
end
|
33
38
|
end
|
34
39
|
save_strage
|
40
|
+
@logger.info('end of update')
|
35
41
|
end
|
36
42
|
|
37
43
|
def get_strage
|
@@ -86,7 +92,7 @@ module ConsadoleAggregator
|
|
86
92
|
[
|
87
93
|
->{ get_resource('http://hochi.yomiuri.co.jp/hokkaido/soccer/index.htm') },
|
88
94
|
->(list){ Nokogiri::HTML(list).search('div.list1 > ul > li a').reverse },
|
89
|
-
->(article){ { url:"http://hochi.yomiuri.co.jp
|
95
|
+
->(article){ { url:"http://hochi.yomiuri.co.jp#{article['href']}", title:article.text } if article.text =~ /…札幌$/ }
|
90
96
|
],
|
91
97
|
Asahi:
|
92
98
|
[
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: consadole_aggregator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- niku
|
@@ -270,7 +270,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
270
270
|
requirements:
|
271
271
|
- - ">="
|
272
272
|
- !ruby/object:Gem::Version
|
273
|
-
hash: -
|
273
|
+
hash: -1265943250019718136
|
274
274
|
segments:
|
275
275
|
- 0
|
276
276
|
version: "0"
|