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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0350f796d13420df577920dd011de37b84f150e
4
- data.tar.gz: c821cb09d792a337a31e3b34d6c412de8b74c5ab
3
+ metadata.gz: f67e46204a21d2f102acdbff2cd9d8ab32b00e00
4
+ data.tar.gz: aa3799ef8696da7f68824d7b2618dcd8d90d2d37
5
5
  SHA512:
6
- metadata.gz: cd794c5089fe236d2ca4e550837810d46108ba33f44e695ebb5e972399e039279f02d3714a05820b14f19b754762a76e96d99992a53a58864231249a79936959
7
- data.tar.gz: fbfa5dd103337bef064d8a25d9ee595c0ea49319cc6bd1c2ff06701b60049f42d23bdd61f8b66d18d69a3ff4d153df2dd4837895babdad17b14988dad081c9f3
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: :daily
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
- p app_detail.title
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}/pc/r/#{@os_type}/#{@feed}"
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
@@ -1,3 +1,3 @@
1
1
  module YoyakutoptenScraper
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yoyakutopten_scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryysd