yoyakutopten_scraper 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/test.rb +5 -6
- data/lib/yoyakutopten_scraper/ranking.rb +4 -4
- data/lib/yoyakutopten_scraper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f67e46204a21d2f102acdbff2cd9d8ab32b00e00
|
4
|
+
data.tar.gz: aa3799ef8696da7f68824d7b2618dcd8d90d2d37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba99b773cd50b73b99fc7eb0947469a2bf1f8e659c4708fca04fcbd7d485a879c8bbcc0d374bb2ae07208aeafcd1f30adbc0d1e292b03c84f21cd45e71ea3b49
|
7
|
+
data.tar.gz: 83f4e85bdc9d57e958c7888e4141076170348ce4786b5f8c47b0e9b32af47fb175c45e1eccf8cfc5f67552387f02ca323d347862d7e2dfdd1c2788b2d96ce778
|
data/lib/test.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
require 'yoyakutopten_scraper'
|
2
2
|
|
3
|
-
ranking = YoyakutoptenScraper::Ranking.new os_type: :ios, feed: :
|
3
|
+
ranking = YoyakutoptenScraper::Ranking.new os_type: :ios, feed: :total
|
4
4
|
ranking.update
|
5
5
|
|
6
|
+
p ranking.results
|
7
|
+
|
6
8
|
app = ranking.results.first
|
7
9
|
|
8
10
|
app_detail = YoyakutoptenScraper::App.new app_id: app[:app_id], os_type: app[:os_type]
|
9
11
|
bonus_detail = YoyakutoptenScraper::Bonus.new bonus_id: app[:bonus_id], os_type: app[:os_type]
|
10
12
|
|
11
13
|
|
12
|
-
app_detail.update
|
13
|
-
|
14
|
-
p app_detail
|
15
|
-
bonus_detail.update
|
16
|
-
p bonus_detail
|
14
|
+
# app_detail.update
|
15
|
+
# bonus_detail.update
|
@@ -18,7 +18,7 @@ module YoyakutoptenScraper
|
|
18
18
|
banner_img = (banner.css 'img').first
|
19
19
|
|
20
20
|
info = (app.css '.bg_rank_summary').first
|
21
|
-
release = ((info.css '.rank_released').first.css 'li').last
|
21
|
+
#release = ((info.css '.rank_released').first.css 'li').last
|
22
22
|
|
23
23
|
detail_rel_url = banner.get_attribute 'href'
|
24
24
|
detail_rel_url.match %r!/[a-zA-Z]+/[a-zA-Z]+/(\w+)!
|
@@ -47,7 +47,7 @@ module YoyakutoptenScraper
|
|
47
47
|
detail_url: detail_url,
|
48
48
|
banner_img_url: banner_url,
|
49
49
|
app_id: app_id,
|
50
|
-
release: release.text,
|
50
|
+
#release: release.text,
|
51
51
|
bonus_id: bonus_id,
|
52
52
|
bonus_url: bonus_url,
|
53
53
|
os_type: @os_type
|
@@ -56,7 +56,7 @@ module YoyakutoptenScraper
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def update
|
59
|
-
query = "#{YoyakutoptenScraper::HOST}
|
59
|
+
query = "#{YoyakutoptenScraper::HOST}/#{YoyakutoptenScraper::MOBILE_PREFIX}/#{@feed}"
|
60
60
|
user_agents = YoyakutoptenScraper::USER_AGENTS[@os_type]
|
61
61
|
request = Typhoeus::Request.new query,
|
62
62
|
method: 'get',
|
@@ -67,4 +67,4 @@ module YoyakutoptenScraper
|
|
67
67
|
self.parse (Nokogiri::HTML.parse response.body)
|
68
68
|
end
|
69
69
|
end
|
70
|
-
end
|
70
|
+
end
|