news2kindle 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/Gemfile.lock +44 -44
- data/lib/news2kindle/generator/nikkei-paid.rb +9 -10
- data/lib/news2kindle/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff3f81306cbaaa66a709b03d7355207ae3c7b893e5bacef9a7ab4c940e9c1a17
|
4
|
+
data.tar.gz: 5ef5c094403022ffa6204a4e920cbe4733d09235e49e2c6881c295f094a92789
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 499a9149f5d169cb1157802825d0d9c55fbd1fb806d8e18dac7e8a175bd2206e8a11b183ade36a5950003836da0dc79a7d364297ab596e60679e75497e433b8a
|
7
|
+
data.tar.gz: eeb15821111272313ca3c37644988f997bfe07aa91d67a687bae12599fa789e995700834011b9a189409efc6f9940c5dfaf3a15acc1374ae580d3afc67e90ca9
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
news2kindle (0.2.
|
4
|
+
news2kindle (0.2.2)
|
5
5
|
dropbox_api
|
6
6
|
kindlegen
|
7
7
|
mail
|
@@ -14,34 +14,34 @@ PATH
|
|
14
14
|
GEM
|
15
15
|
remote: https://rubygems.org/
|
16
16
|
specs:
|
17
|
-
activemodel (5.2.
|
18
|
-
activesupport (= 5.2.
|
19
|
-
activesupport (5.2.
|
17
|
+
activemodel (5.2.3)
|
18
|
+
activesupport (= 5.2.3)
|
19
|
+
activesupport (5.2.3)
|
20
20
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
21
21
|
i18n (>= 0.7, < 2)
|
22
22
|
minitest (~> 5.1)
|
23
23
|
tzinfo (~> 1.1)
|
24
|
-
bson (4.
|
24
|
+
bson (4.4.2)
|
25
25
|
coderay (1.1.2)
|
26
|
-
concurrent-ruby (1.
|
26
|
+
concurrent-ruby (1.1.5)
|
27
27
|
connection_pool (2.2.2)
|
28
28
|
diff-lcs (1.3)
|
29
29
|
domain_name (0.5.20180417)
|
30
30
|
unf (>= 0.0.5, < 1.0.0)
|
31
|
-
dropbox_api (0.1.
|
32
|
-
faraday (
|
31
|
+
dropbox_api (0.1.16)
|
32
|
+
faraday (>= 0.8, <= 0.15.4)
|
33
33
|
oauth2 (~> 1.1)
|
34
|
-
faraday (0.
|
34
|
+
faraday (0.15.4)
|
35
35
|
multipart-post (>= 1.2, < 3)
|
36
36
|
http-cookie (1.0.3)
|
37
37
|
domain_name (~> 0.5)
|
38
|
-
i18n (1.0
|
38
|
+
i18n (1.6.0)
|
39
39
|
concurrent-ruby (~> 1.0)
|
40
|
-
jwt (1.
|
40
|
+
jwt (2.1.0)
|
41
41
|
kindlegen (3.0.3)
|
42
42
|
rake
|
43
43
|
rubyzip
|
44
|
-
mail (2.7.
|
44
|
+
mail (2.7.1)
|
45
45
|
mini_mime (>= 0.1.1)
|
46
46
|
mechanize (2.7.6)
|
47
47
|
domain_name (~> 0.5, >= 0.5.1)
|
@@ -52,60 +52,60 @@ GEM
|
|
52
52
|
nokogiri (~> 1.6)
|
53
53
|
ntlm-http (~> 0.1, >= 0.1.1)
|
54
54
|
webrobots (>= 0.0.9, < 0.2)
|
55
|
-
method_source (0.9.
|
56
|
-
mime-types (3.
|
55
|
+
method_source (0.9.2)
|
56
|
+
mime-types (3.2.2)
|
57
57
|
mime-types-data (~> 3.2015)
|
58
|
-
mime-types-data (3.
|
59
|
-
mini_mime (1.0.
|
60
|
-
mini_portile2 (2.
|
58
|
+
mime-types-data (3.2019.0331)
|
59
|
+
mini_mime (1.0.1)
|
60
|
+
mini_portile2 (2.4.0)
|
61
61
|
minitest (5.11.3)
|
62
|
-
mongo (2.
|
63
|
-
bson (>= 4.
|
64
|
-
mongoid (7.0.
|
62
|
+
mongo (2.8.0)
|
63
|
+
bson (>= 4.4.2, < 5.0.0)
|
64
|
+
mongoid (7.0.2)
|
65
65
|
activemodel (>= 5.1, < 6.0.0)
|
66
66
|
mongo (>= 2.5.1, < 3.0.0)
|
67
67
|
multi_json (1.13.1)
|
68
68
|
multi_xml (0.6.0)
|
69
|
-
multipart-post (2.
|
69
|
+
multipart-post (2.1.0)
|
70
70
|
net-http-digest_auth (1.4.1)
|
71
|
-
net-http-persistent (3.0.
|
71
|
+
net-http-persistent (3.0.1)
|
72
72
|
connection_pool (~> 2.2)
|
73
|
-
nokogiri (1.
|
74
|
-
mini_portile2 (~> 2.
|
73
|
+
nokogiri (1.10.3)
|
74
|
+
mini_portile2 (~> 2.4.0)
|
75
75
|
ntlm-http (0.1.1)
|
76
|
-
oauth2 (1.4.
|
77
|
-
faraday (>= 0.8, < 0.
|
78
|
-
jwt (
|
76
|
+
oauth2 (1.4.1)
|
77
|
+
faraday (>= 0.8, < 0.16.0)
|
78
|
+
jwt (>= 1.0, < 3.0)
|
79
79
|
multi_json (~> 1.3)
|
80
80
|
multi_xml (~> 0.5)
|
81
81
|
rack (>= 1.2, < 3)
|
82
82
|
pit (0.0.7)
|
83
|
-
pry (0.
|
83
|
+
pry (0.12.2)
|
84
84
|
coderay (~> 1.1.0)
|
85
85
|
method_source (~> 0.9.0)
|
86
|
-
rack (2.0.
|
87
|
-
rake (12.3.
|
88
|
-
rspec (3.
|
89
|
-
rspec-core (~> 3.
|
90
|
-
rspec-expectations (~> 3.
|
91
|
-
rspec-mocks (~> 3.
|
92
|
-
rspec-core (3.
|
93
|
-
rspec-support (~> 3.
|
94
|
-
rspec-expectations (3.
|
86
|
+
rack (2.0.7)
|
87
|
+
rake (12.3.2)
|
88
|
+
rspec (3.8.0)
|
89
|
+
rspec-core (~> 3.8.0)
|
90
|
+
rspec-expectations (~> 3.8.0)
|
91
|
+
rspec-mocks (~> 3.8.0)
|
92
|
+
rspec-core (3.8.0)
|
93
|
+
rspec-support (~> 3.8.0)
|
94
|
+
rspec-expectations (3.8.3)
|
95
95
|
diff-lcs (>= 1.2.0, < 2.0)
|
96
|
-
rspec-support (~> 3.
|
97
|
-
rspec-mocks (3.
|
96
|
+
rspec-support (~> 3.8.0)
|
97
|
+
rspec-mocks (3.8.0)
|
98
98
|
diff-lcs (>= 1.2.0, < 2.0)
|
99
|
-
rspec-support (~> 3.
|
100
|
-
rspec-support (3.
|
101
|
-
rubyzip (1.2.
|
99
|
+
rspec-support (~> 3.8.0)
|
100
|
+
rspec-support (3.8.0)
|
101
|
+
rubyzip (1.2.2)
|
102
102
|
systemu (2.6.5)
|
103
103
|
thread_safe (0.3.6)
|
104
104
|
tzinfo (1.2.5)
|
105
105
|
thread_safe (~> 0.1)
|
106
106
|
unf (0.1.4)
|
107
107
|
unf_ext
|
108
|
-
unf_ext (0.0.7.
|
108
|
+
unf_ext (0.0.7.6)
|
109
109
|
webrobots (0.1.2)
|
110
110
|
|
111
111
|
PLATFORMS
|
@@ -119,4 +119,4 @@ DEPENDENCIES
|
|
119
119
|
rspec
|
120
120
|
|
121
121
|
BUNDLED WITH
|
122
|
-
1.
|
122
|
+
1.17.2
|
@@ -13,7 +13,6 @@ module News2Kindle
|
|
13
13
|
class IllegalPage < StandardError; end
|
14
14
|
|
15
15
|
TOP = 'https://www.nikkei.com'
|
16
|
-
LOGIN = "#{TOP}/etc/accounts/login?dps=3&pageflag=top&url=http%3A%2F%2Fwww.nikkei.com%2F"
|
17
16
|
|
18
17
|
def initialize( tmpdir )
|
19
18
|
@nikkei_id, @nikkei_pw = auth
|
@@ -34,28 +33,28 @@ module News2Kindle
|
|
34
33
|
@now_str = @now.strftime '%Y-%m-%d %H:%M'
|
35
34
|
|
36
35
|
agent = Mechanize::new
|
36
|
+
agent.user_agent_alias = "Windows Chrome"
|
37
37
|
agent.set_proxy( *ENV['HTTP_PROXY'].split( /:/ ) ) if ENV['HTTP_PROXY']
|
38
38
|
|
39
39
|
toc = []
|
40
40
|
if @nikkei_id and @nikkei_pw
|
41
|
-
agent.get('https://
|
42
|
-
agent.
|
43
|
-
|
44
|
-
|
45
|
-
form['LA7010Form01:LA7010Email'] = @nikkei_id
|
46
|
-
form['LA7010Form01:LA7010Password'] = @nikkei_pw
|
41
|
+
agent.get('https://id.nikkei.com/lounge/li/main/')
|
42
|
+
agent.page.form_with(name: 'LA0120Form01') do |form|
|
43
|
+
form['LA0120Form01:LA0120Email'] = @nikkei_id
|
44
|
+
form['LA0120Form01:LA0120Password'] = @nikkei_pw
|
47
45
|
form.click_button
|
48
46
|
end
|
49
|
-
agent.
|
47
|
+
agent.get(TOP)
|
48
|
+
agent.page.form_with(name: 'autoPostForm').click_button
|
50
49
|
else
|
51
|
-
agent.get(
|
50
|
+
agent.get(TOP)
|
52
51
|
end
|
53
52
|
|
54
53
|
#
|
55
54
|
# scraping top news
|
56
55
|
#
|
57
56
|
toc_top = ['TOP NEWS']
|
58
|
-
(agent.page / '
|
57
|
+
(agent.page / 'div.m-miM11_box h3 a').each do |a|
|
59
58
|
uri = a.attr('href')
|
60
59
|
next if News2Kindle::DupChecker.dup?(uri)
|
61
60
|
toc_top << [canonical(a.text.strip), uri]
|
data/lib/news2kindle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: news2kindle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TADA Tadashi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kindlegen
|
@@ -242,8 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
242
242
|
- !ruby/object:Gem::Version
|
243
243
|
version: '0'
|
244
244
|
requirements: []
|
245
|
-
|
246
|
-
rubygems_version: 2.7.7
|
245
|
+
rubygems_version: 3.0.3
|
247
246
|
signing_key:
|
248
247
|
specification_version: 4
|
249
248
|
summary: scrape some news site and deliver to kindle
|