news2kindle 0.2.1 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0d34c543c061201544fcee0ccd68b3e01cce180ce1a0d9822bb9fd8c3db4618
4
- data.tar.gz: 802398bdce7deb79c21b08c0b20ec21095c5b84e579984a32c28664a21d4e1b4
3
+ metadata.gz: ff3f81306cbaaa66a709b03d7355207ae3c7b893e5bacef9a7ab4c940e9c1a17
4
+ data.tar.gz: 5ef5c094403022ffa6204a4e920cbe4733d09235e49e2c6881c295f094a92789
5
5
  SHA512:
6
- metadata.gz: 2d45477e45cb994a4395f562632a7bb21c2057383eb9e0240ef10b871b4a5ff73212cbdf124c90db7b941b85412f273300bc44d2b3989b298589730cc77b79e0
7
- data.tar.gz: 12aab9e50185810d2fe65b384a9a4e8acacb7d9c1c68bee8d21b2d5cf9e5f88c635edd6cdc1e7e5f32a4737905d217e49840a088a623ea83180b0d17d605b654
6
+ metadata.gz: 499a9149f5d169cb1157802825d0d9c55fbd1fb806d8e18dac7e8a175bd2206e8a11b183ade36a5950003836da0dc79a7d364297ab596e60679e75497e433b8a
7
+ data.tar.gz: eeb15821111272313ca3c37644988f997bfe07aa91d67a687bae12599fa789e995700834011b9a189409efc6f9940c5dfaf3a15acc1374ae580d3afc67e90ca9
data/.travis.yml CHANGED
@@ -5,8 +5,9 @@ before_install:
5
5
  - gem install bundler -v 1.16.2
6
6
 
7
7
  rvm:
8
- - 2.4.4
9
- - 2.5.1
8
+ - 2.4.5
9
+ - 2.5.4
10
+ - 2.6.3
10
11
 
11
12
  script: bundle exec rake
12
13
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- news2kindle (0.2.1)
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.0)
18
- activesupport (= 5.2.0)
19
- activesupport (5.2.0)
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.3.0)
24
+ bson (4.4.2)
25
25
  coderay (1.1.2)
26
- concurrent-ruby (1.0.5)
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.12)
32
- faraday (~> 0.9, ~> 0.8)
31
+ dropbox_api (0.1.16)
32
+ faraday (>= 0.8, <= 0.15.4)
33
33
  oauth2 (~> 1.1)
34
- faraday (0.12.2)
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.1)
38
+ i18n (1.6.0)
39
39
  concurrent-ruby (~> 1.0)
40
- jwt (1.5.6)
40
+ jwt (2.1.0)
41
41
  kindlegen (3.0.3)
42
42
  rake
43
43
  rubyzip
44
- mail (2.7.0)
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.0)
56
- mime-types (3.1)
55
+ method_source (0.9.2)
56
+ mime-types (3.2.2)
57
57
  mime-types-data (~> 3.2015)
58
- mime-types-data (3.2016.0521)
59
- mini_mime (1.0.0)
60
- mini_portile2 (2.3.0)
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.5.3)
63
- bson (>= 4.3.0, < 5.0.0)
64
- mongoid (7.0.1)
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.0.0)
69
+ multipart-post (2.1.0)
70
70
  net-http-digest_auth (1.4.1)
71
- net-http-persistent (3.0.0)
71
+ net-http-persistent (3.0.1)
72
72
  connection_pool (~> 2.2)
73
- nokogiri (1.8.4)
74
- mini_portile2 (~> 2.3.0)
73
+ nokogiri (1.10.3)
74
+ mini_portile2 (~> 2.4.0)
75
75
  ntlm-http (0.1.1)
76
- oauth2 (1.4.0)
77
- faraday (>= 0.8, < 0.13)
78
- jwt (~> 1.0)
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.11.3)
83
+ pry (0.12.2)
84
84
  coderay (~> 1.1.0)
85
85
  method_source (~> 0.9.0)
86
- rack (2.0.5)
87
- rake (12.3.1)
88
- rspec (3.7.0)
89
- rspec-core (~> 3.7.0)
90
- rspec-expectations (~> 3.7.0)
91
- rspec-mocks (~> 3.7.0)
92
- rspec-core (3.7.1)
93
- rspec-support (~> 3.7.0)
94
- rspec-expectations (3.7.0)
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.7.0)
97
- rspec-mocks (3.7.0)
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.7.0)
100
- rspec-support (3.7.1)
101
- rubyzip (1.2.1)
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.5)
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.16.2
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&amp;pageflag=top&amp;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://regist.nikkei.com/ds/etc/accounts/logout')
42
- agent.get( LOGIN )
43
- agent.page.form_with( :name => 'autoPostForm' ).submit
44
- agent.page.form_with( :name => 'LA7010Form01' ) do |form|
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.page.forms.first.submit
47
+ agent.get(TOP)
48
+ agent.page.form_with(name: 'autoPostForm').click_button
50
49
  else
51
- agent.get( TOP )
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 / '#JSID_baseRefreshNxTop2 h3 a').each do |a|
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]
@@ -1,3 +1,3 @@
1
1
  module News2Kindle
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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: 2018-07-27 00:00:00.000000000 Z
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
- rubyforge_project:
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