dmm-crawler 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +1 -0
- data/CHANGELOG.md +3 -0
- data/README.md +3 -0
- data/lib/dmm-crawler/attributes.rb +9 -2
- data/lib/dmm-crawler/ranking.rb +3 -2
- data/lib/dmm-crawler/version.rb +1 -1
- data/spec/dmm-crawler/ranking_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a63c5c9dd8d6e46df1f00d53eaa4f0cd95b2bffcd2406f155bd582eb864d9cb8
|
4
|
+
data.tar.gz: 16d93c3d3806d8a87abff9e53ec2c89403a8b2fd492d513aa8da947195d5e2da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3232d0428c2d8a2211412c850a2d1a0f6b03dcd5ffd0097ba0ed366cb8b875b734ddc0c3c6966ee21d3efc334e163506869a443417e1dbba8701715bd3b97a0f
|
7
|
+
data.tar.gz: 749b25cc7e6bc4038f873de594f8ffe0fc8fb292c177fa717eb64c2a1907ec68104f08c2a5e023f12ba18445f564c7557c21a8580d8edc62d5004736cfa76c89
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -34,7 +34,10 @@ client.rankings(term: '24', submedia: 'cg')
|
|
34
34
|
# title_link: "title url",
|
35
35
|
# image_url: "Link to title"s main image",
|
36
36
|
# submedia: "cg",
|
37
|
+
# author: "author",
|
37
38
|
# informations: [{key: 'key', value: 'value'}],
|
39
|
+
# rank: '1'
|
40
|
+
# price: '1000'
|
38
41
|
# tags: ["tag1", "tag2"]
|
39
42
|
# }
|
40
43
|
```
|
@@ -12,6 +12,7 @@ module DMMCrawler
|
|
12
12
|
submedia,
|
13
13
|
author,
|
14
14
|
informations,
|
15
|
+
price,
|
15
16
|
tags
|
16
17
|
]
|
17
18
|
end
|
@@ -59,6 +60,12 @@ module DMMCrawler
|
|
59
60
|
.delete('-')
|
60
61
|
end
|
61
62
|
|
63
|
+
def price
|
64
|
+
@page
|
65
|
+
.search('.m-priceList .priceList__sub.priceList__sub--big')
|
66
|
+
.text.strip.delete('円,')
|
67
|
+
end
|
68
|
+
|
62
69
|
def author
|
63
70
|
@page.search('div.circleName__item').text.strip
|
64
71
|
end
|
@@ -71,7 +78,7 @@ module DMMCrawler
|
|
71
78
|
series = information.find { |array| array.first == 'シリーズ' }
|
72
79
|
|
73
80
|
if series
|
74
|
-
information = information.
|
81
|
+
information = information.reject { |array| array.first == 'シリーズ' }
|
75
82
|
information.push(series)
|
76
83
|
end
|
77
84
|
|
@@ -88,7 +95,7 @@ module DMMCrawler
|
|
88
95
|
|
89
96
|
def extract_text(elements)
|
90
97
|
elements
|
91
|
-
.
|
98
|
+
.reject { |element| element.text.strip == 'ジャンル' }
|
92
99
|
.map { |element| element.children.text.strip }
|
93
100
|
end
|
94
101
|
|
data/lib/dmm-crawler/ranking.rb
CHANGED
@@ -15,7 +15,7 @@ module DMMCrawler
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
|
-
arts.map.with_index(1) do |(title, title_link, image_url, submedia, author, informations, tags), rank|
|
18
|
+
arts.map.with_index(1) do |(title, title_link, image_url, submedia, author, informations, price, tags), rank|
|
19
19
|
{
|
20
20
|
title: title,
|
21
21
|
title_link: title_link,
|
@@ -24,6 +24,7 @@ module DMMCrawler
|
|
24
24
|
author: author,
|
25
25
|
informations: informations,
|
26
26
|
rank: rank,
|
27
|
+
price: price,
|
27
28
|
tags: tags
|
28
29
|
}
|
29
30
|
end
|
@@ -36,7 +37,7 @@ module DMMCrawler
|
|
36
37
|
end
|
37
38
|
|
38
39
|
def discriminate_term(term)
|
39
|
-
return term if %w
|
40
|
+
return term if %w[24 weekly monthly total].include?(term)
|
40
41
|
raise TypeError
|
41
42
|
end
|
42
43
|
|
data/lib/dmm-crawler/version.rb
CHANGED
@@ -21,7 +21,7 @@ describe DMMCrawler::Ranking do
|
|
21
21
|
|
22
22
|
let(:term) { '24' }
|
23
23
|
|
24
|
-
it { is_expected.to all(include(:title, :title_link, :image_url, :submedia, :author, :informations, :rank, :tags)) }
|
24
|
+
it { is_expected.to all(include(:title, :title_link, :image_url, :submedia, :author, :informations, :rank, :price, :tags)) }
|
25
25
|
it { is_expected.to all(satisfy { |art| art.all? { |_k, v| v != '' } }) }
|
26
26
|
end
|
27
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dmm-crawler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Satoshi Ohmori
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.6
|
143
|
+
rubygems_version: 2.7.6
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: Show DMM and DMM.R18's crawled data
|