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 +4 -4
- data/.circleci/config.yml +1 -1
- data/.ruby-version +1 -1
- data/Gemfile.lock +46 -43
- data/lib/qiita_trend/trend.rb +10 -2
- data/lib/qiita_trend/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70a9cc7194b545d7e249572b9b169d9af92d2f0c9772724c3c613ea83716adc7
|
4
|
+
data.tar.gz: fdc9ff7f7b162e1aff9e85bbdb4d01fdc62c02685df663c0c363dfa0c4e4a937
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e1c0ae0aa1d6a1b25adfe44f9cacd84e6b0a38ca028b395310d375f1ebeb0de4f5a22996e35c3ae5bd966a205f8c5b89cc728f765e5f7cb3323ec5f899a4b1
|
7
|
+
data.tar.gz: 33a24ae3251b6604f1f9509c17abc41d5f2227c4b7d394e705ad45984a97a85ca916657ac3598d082788e1e431f062357d848bb7f311904dc6449f889622ed02
|
data/.circleci/config.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
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.
|
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.
|
12
|
-
public_suffix (>= 2.0.2, <
|
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.
|
16
|
+
connection_pool (2.3.0)
|
17
17
|
crack (0.4.5)
|
18
18
|
rexml
|
19
|
-
diff-lcs (1.
|
20
|
-
docile (1.
|
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.
|
24
|
+
http-cookie (1.0.5)
|
25
25
|
domain_name (~> 0.5)
|
26
|
-
mechanize (2.8.
|
27
|
-
addressable (~> 2.
|
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.
|
38
|
+
mime-types (3.4.1)
|
39
39
|
mime-types-data (~> 3.2015)
|
40
|
-
mime-types-data (3.
|
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.
|
45
|
+
nokogiri (1.13.9)
|
46
|
+
mini_portile2 (~> 2.8.0)
|
45
47
|
racc (~> 1.4)
|
46
|
-
parallel (1.
|
47
|
-
parser (3.
|
48
|
+
parallel (1.22.1)
|
49
|
+
parser (3.1.2.1)
|
48
50
|
ast (~> 2.4.1)
|
49
|
-
pry (0.
|
51
|
+
pry (0.14.1)
|
50
52
|
coderay (~> 1.1)
|
51
53
|
method_source (~> 1.0)
|
52
|
-
pry-byebug (3.
|
54
|
+
pry-byebug (3.10.1)
|
53
55
|
byebug (~> 11.0)
|
54
|
-
pry (
|
55
|
-
pry-doc (1.
|
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 (
|
59
|
-
racc (1.
|
60
|
-
rainbow (3.
|
61
|
-
rake (13.0.
|
62
|
-
regexp_parser (2.
|
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.
|
65
|
-
rspec-core (~> 3.
|
66
|
-
rspec-expectations (~> 3.
|
67
|
-
rspec-mocks (~> 3.
|
68
|
-
rspec-core (3.
|
69
|
-
rspec-support (~> 3.
|
70
|
-
rspec-expectations (3.
|
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.
|
73
|
-
rspec-mocks (3.
|
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.
|
76
|
-
rspec-support (3.
|
77
|
-
rspec_junit_formatter (0.
|
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.
|
89
|
-
parser (>=
|
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.
|
102
|
+
simplecov_json_formatter (0.1.4)
|
101
103
|
unf (0.1.4)
|
102
104
|
unf_ext
|
103
|
-
unf_ext (0.0.
|
104
|
-
unicode-display_width (1.
|
105
|
+
unf_ext (0.0.8.2)
|
106
|
+
unicode-display_width (1.8.0)
|
105
107
|
vcr (5.1.0)
|
106
|
-
webmock (3.
|
107
|
-
addressable (>= 2.
|
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.
|
114
|
+
yard (0.9.28)
|
115
|
+
webrick (~> 1.7.0)
|
113
116
|
|
114
117
|
PLATFORMS
|
115
118
|
ruby
|
data/lib/qiita_trend/trend.rb
CHANGED
@@ -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 =
|
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']['
|
76
|
+
trend_type == TrendType::PERSONAL ? trends_data['personalizedFeed']['personalizedFeed']['edges'] : trends_data['trend']['edges']
|
69
77
|
end
|
70
78
|
|
71
79
|
# ユーザーの画像のURLを取得する
|
data/lib/qiita_trend/version.rb
CHANGED
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.
|
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:
|
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.
|
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
|