qiita_trend 0.5.1 → 0.5.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad6633f75fafb54ce0bbc8438e3f94ae716ff1001baecac98ba5f141a6d59efd
4
- data.tar.gz: a71a9b6fd1901f0031c248d8c8a2624de99dbce2b979d44a2c28ecc8708f3aad
3
+ metadata.gz: 70a9cc7194b545d7e249572b9b169d9af92d2f0c9772724c3c613ea83716adc7
4
+ data.tar.gz: fdc9ff7f7b162e1aff9e85bbdb4d01fdc62c02685df663c0c363dfa0c4e4a937
5
5
  SHA512:
6
- metadata.gz: 06426b8b6d6118d52c612aa110c21cf6ce3553d2d1f95c1eb7c24440834c0be93aedd5144ec7d770ce03e2fcee3d83cfc19a6105ddc74902e981bbd9170ffb50
7
- data.tar.gz: 171a7c15b21baed1f98ee3ab328d310908ce94033d7c64cc8a1bbe8c6ee7f5b37688077364852e5c90347885d6a1659a37a5a2ccc332c1e796716f5c9faa4640
6
+ metadata.gz: f1e1c0ae0aa1d6a1b25adfe44f9cacd84e6b0a38ca028b395310d375f1ebeb0de4f5a22996e35c3ae5bd966a205f8c5b89cc728f765e5f7cb3323ec5f899a4b1
7
+ data.tar.gz: 33a24ae3251b6604f1f9509c17abc41d5f2227c4b7d394e705ad45984a97a85ca916657ac3598d082788e1e431f062357d848bb7f311904dc6449f889622ed02
data/.circleci/config.yml CHANGED
@@ -5,7 +5,7 @@ orbs:
5
5
  executors:
6
6
  base:
7
7
  docker:
8
- - image: cimg/ruby:2.6.6
8
+ - image: cimg/ruby:2.7.0
9
9
  auth:
10
10
  username: dodonki1223
11
11
  password: $DOCKERHUB_PASSWORD
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 2.7.0
data/Gemfile.lock CHANGED
@@ -1,30 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qiita_trend (0.5.1)
4
+ qiita_trend (0.5.3)
5
5
  mechanize (~> 2.7)
6
6
  nokogiri (~> 1.11)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.7.0)
12
- public_suffix (>= 2.0.2, < 5.0)
11
+ addressable (2.8.1)
12
+ public_suffix (>= 2.0.2, < 6.0)
13
13
  ast (2.4.2)
14
14
  byebug (11.1.3)
15
15
  coderay (1.1.3)
16
- connection_pool (2.2.3)
16
+ connection_pool (2.3.0)
17
17
  crack (0.4.5)
18
18
  rexml
19
- diff-lcs (1.4.4)
20
- docile (1.3.5)
19
+ diff-lcs (1.5.0)
20
+ docile (1.4.0)
21
21
  domain_name (0.5.20190701)
22
22
  unf (>= 0.0.5, < 1.0.0)
23
23
  hashdiff (1.0.1)
24
- http-cookie (1.0.3)
24
+ http-cookie (1.0.5)
25
25
  domain_name (~> 0.5)
26
- mechanize (2.8.0)
27
- addressable (~> 2.7)
26
+ mechanize (2.8.5)
27
+ addressable (~> 2.8)
28
28
  domain_name (~> 0.5, >= 0.5.20190701)
29
29
  http-cookie (~> 1.0, >= 1.0.3)
30
30
  mime-types (~> 3.0)
@@ -35,46 +35,48 @@ GEM
35
35
  webrick (~> 1.7)
36
36
  webrobots (~> 0.1.2)
37
37
  method_source (1.0.0)
38
- mime-types (3.3.1)
38
+ mime-types (3.4.1)
39
39
  mime-types-data (~> 3.2015)
40
- mime-types-data (3.2021.0225)
40
+ mime-types-data (3.2022.0105)
41
+ mini_portile2 (2.8.0)
41
42
  net-http-digest_auth (1.4.1)
42
43
  net-http-persistent (4.0.1)
43
44
  connection_pool (~> 2.2)
44
- nokogiri (1.11.2)
45
+ nokogiri (1.13.9)
46
+ mini_portile2 (~> 2.8.0)
45
47
  racc (~> 1.4)
46
- parallel (1.20.1)
47
- parser (3.0.1.0)
48
+ parallel (1.22.1)
49
+ parser (3.1.2.1)
48
50
  ast (~> 2.4.1)
49
- pry (0.13.1)
51
+ pry (0.14.1)
50
52
  coderay (~> 1.1)
51
53
  method_source (~> 1.0)
52
- pry-byebug (3.9.0)
54
+ pry-byebug (3.10.1)
53
55
  byebug (~> 11.0)
54
- pry (~> 0.13.0)
55
- pry-doc (1.1.0)
56
+ pry (>= 0.13, < 0.15)
57
+ pry-doc (1.3.0)
56
58
  pry (~> 0.11)
57
59
  yard (~> 0.9.11)
58
- public_suffix (4.0.6)
59
- racc (1.5.2)
60
- rainbow (3.0.0)
61
- rake (13.0.3)
62
- regexp_parser (2.1.1)
60
+ public_suffix (5.0.0)
61
+ racc (1.6.0)
62
+ rainbow (3.1.1)
63
+ rake (13.0.6)
64
+ regexp_parser (2.6.0)
63
65
  rexml (3.2.5)
64
- rspec (3.10.0)
65
- rspec-core (~> 3.10.0)
66
- rspec-expectations (~> 3.10.0)
67
- rspec-mocks (~> 3.10.0)
68
- rspec-core (3.10.1)
69
- rspec-support (~> 3.10.0)
70
- rspec-expectations (3.10.1)
66
+ rspec (3.12.0)
67
+ rspec-core (~> 3.12.0)
68
+ rspec-expectations (~> 3.12.0)
69
+ rspec-mocks (~> 3.12.0)
70
+ rspec-core (3.12.0)
71
+ rspec-support (~> 3.12.0)
72
+ rspec-expectations (3.12.0)
71
73
  diff-lcs (>= 1.2.0, < 2.0)
72
- rspec-support (~> 3.10.0)
73
- rspec-mocks (3.10.2)
74
+ rspec-support (~> 3.12.0)
75
+ rspec-mocks (3.12.0)
74
76
  diff-lcs (>= 1.2.0, < 2.0)
75
- rspec-support (~> 3.10.0)
76
- rspec-support (3.10.2)
77
- rspec_junit_formatter (0.4.1)
77
+ rspec-support (~> 3.12.0)
78
+ rspec-support (3.12.0)
79
+ rspec_junit_formatter (0.6.0)
78
80
  rspec-core (>= 2, < 4, != 2.12.0)
79
81
  rubocop (0.93.1)
80
82
  parallel (~> 1.10)
@@ -85,8 +87,8 @@ GEM
85
87
  rubocop-ast (>= 0.6.0)
86
88
  ruby-progressbar (~> 1.7)
87
89
  unicode-display_width (>= 1.4.0, < 2.0)
88
- rubocop-ast (1.4.1)
89
- parser (>= 2.7.1.5)
90
+ rubocop-ast (1.23.0)
91
+ parser (>= 3.1.1.0)
90
92
  rubocop-rspec (1.44.1)
91
93
  rubocop (~> 0.87)
92
94
  rubocop-ast (>= 0.7.1)
@@ -97,19 +99,20 @@ GEM
97
99
  simplecov-html (~> 0.11)
98
100
  simplecov_json_formatter (~> 0.1)
99
101
  simplecov-html (0.12.3)
100
- simplecov_json_formatter (0.1.2)
102
+ simplecov_json_formatter (0.1.4)
101
103
  unf (0.1.4)
102
104
  unf_ext
103
- unf_ext (0.0.7.7)
104
- unicode-display_width (1.7.0)
105
+ unf_ext (0.0.8.2)
106
+ unicode-display_width (1.8.0)
105
107
  vcr (5.1.0)
106
- webmock (3.12.2)
107
- addressable (>= 2.3.6)
108
+ webmock (3.18.1)
109
+ addressable (>= 2.8.0)
108
110
  crack (>= 0.3.2)
109
111
  hashdiff (>= 0.4.0, < 2.0.0)
110
112
  webrick (1.7.0)
111
113
  webrobots (0.1.2)
112
- yard (0.9.26)
114
+ yard (0.9.28)
115
+ webrick (~> 1.7.0)
113
116
 
114
117
  PLATFORMS
115
118
  ruby
@@ -22,7 +22,7 @@ module QiitaTrend
22
22
  @trend_type = trend_type
23
23
  page = Page.new(trend_type, date)
24
24
  parsed_html = Nokogiri::HTML.parse(page.html)
25
- xpath_str = '//script[@data-component-name="HomeIndexPage"]'
25
+ xpath_str = get_xpath(trend_type)
26
26
  trends_data = JSON.parse(parsed_html.xpath(xpath_str)[0].text)
27
27
  @data = get_data(trends_data, trend_type)
28
28
  end
@@ -59,13 +59,21 @@ module QiitaTrend
59
59
 
60
60
  private
61
61
 
62
+ # Qiitaのトレンド情報を格納しているxpathを取得する
63
+ #
64
+ # @param [TrendType] trend_type トレンドタイプ
65
+ # @return [String] トレンドタイプによるxpath
66
+ def get_xpath(trend_type)
67
+ trend_type == TrendType::PERSONAL ? '//script[@data-component-name="New2HomeIndexPage"]' : '//script[@data-component-name="New2HomeTrendPage"]'
68
+ end
69
+
62
70
  # Qiitaのトレンドのデータを取得する
63
71
  #
64
72
  # @param [Hash] trends_data トレンドデータ
65
73
  # @param [TrendType] trend_type トレンドタイプ
66
74
  # @return [Array] トレンドタイプによるトレンドデータ
67
75
  def get_data(trends_data, trend_type)
68
- trend_type == TrendType::PERSONAL ? trends_data['personalizedFeed']['personalizedFeed']['edges'] : trends_data['trend']['trend']['edges']
76
+ trend_type == TrendType::PERSONAL ? trends_data['personalizedFeed']['personalizedFeed']['edges'] : trends_data['trend']['edges']
69
77
  end
70
78
 
71
79
  # ユーザーの画像のURLを取得する
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module QiitaTrend
4
- VERSION = '0.5.1'
4
+ VERSION = '0.5.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qiita_trend
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - dodonki1223
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-28 00:00:00.000000000 Z
11
+ date: 2022-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  requirements: []
274
- rubygems_version: 3.1.3
274
+ rubygems_version: 3.1.2
275
275
  signing_key:
276
276
  specification_version: 4
277
277
  summary: Easy to get trend for Qiita in 10 seconds