play_scrape 0.0.2 → 0.0.3

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: 182ca4d7ec89471e96bac8a303344ab98f64aa02
4
- data.tar.gz: bf090562f1c9bd971f1644c9ff4dc606e9dccba7
3
+ metadata.gz: db0c57695c095a230aa69247d7c7304ace70d017
4
+ data.tar.gz: 70f62dd285d7fce07e36b85028e0e1badf97bd0d
5
5
  SHA512:
6
- metadata.gz: 556e971769356b110afe67bd029d55fd60cea17dd0b1c312b1b404f40b532a57b706b1a7fd1002354902b63e0ba510ef7d5956fa06f423fb51f23365d86e7b68
7
- data.tar.gz: 1d4624eebd66ebc8e9e5bd4a2e021f1b252304c3769aefecad99ba258deecb6a51dab97a1f037e4f226acbaa8747464b18ae5d610f7f20bfbc553812e14de7e3
6
+ metadata.gz: 35a2c4bd003c261a2f74dde1f63ee9725b04771effcbb5d83a02cdcf5aa3f2ff716dc32695c961f28b2a6883d7e956e8bc9c384199880449f08686a44b78aed0
7
+ data.tar.gz: 86d82509d3c818026f311b0f1f21ee7a8678d59dd79ef41c26f72261c6b76a740323bd7fcb7e2de1a50e8d68d88f83210073f9e0b3dd3bf53a63c9208e06afef
@@ -1,6 +1,6 @@
1
1
  module PlayScrape
2
2
  class AppInfo
3
- attr_accessor :package_name, :description, :rating, :num_ratings, :dev_url, :icon_url,
3
+ attr_accessor :app_name, :package_name, :description, :rating, :num_ratings, :dev_url, :icon_url,
4
4
  :min_installs, :max_installs
5
5
 
6
6
  def initialize
@@ -1,3 +1,3 @@
1
1
  module PlayScrape
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/play_scrape.rb CHANGED
@@ -14,6 +14,7 @@ module PlayScrape
14
14
  APP_NUM_RATINGS_CSS_PATH = 'span.reviews-num'
15
15
  APP_DEV_URL_CSS_PATH = 'a.dev-link'
16
16
  APP_INSTALL_CSS_PATH = 'div.details-section div.details-section-contents div.meta-info div.content'
17
+ APP_NAME_CSS_PATH = 'div.details-wrapper div.details-info div.info-container div.document-title div'
17
18
 
18
19
 
19
20
  # Returns @app_info of AppInfo class
@@ -23,6 +24,7 @@ module PlayScrape
23
24
  if res.code == 200
24
25
  app_info = PlayScrape::AppInfo.new
25
26
  html = Nokogiri::HTML(res.body)
27
+ name = html.css(APP_NAME_CSS_PATH).first
26
28
  description = html.css(APP_DESC_CSS_PATH).first
27
29
  app_rating = html.css(APP_RATING_CSS_PATH).first
28
30
  num_ratings = html.css(APP_NUM_RATINGS_CSS_PATH).first
@@ -38,6 +40,7 @@ module PlayScrape
38
40
  dev_url = dev_links.first.attributes['href'].value.match(regex)[1]
39
41
  end
40
42
 
43
+ app_info.app_name = name.text
41
44
  app_info.package_name = package_name
42
45
  app_info.description = description.inner_html
43
46
  app_info.rating = app_rating.text.to_f
@@ -6,6 +6,8 @@ class PlayScrapeTest < Test::Unit::TestCase
6
6
  def test_scraping_app_information
7
7
  app_info = PlayScrape.scrape_app_info(TEST_PACKAGE)
8
8
 
9
+
10
+ assert_equal 'FIFA 14 by EA SPORTS™', app_info.app_name
9
11
  assert_equal 'com.ea.game.fifa14_na', app_info.package_name, "Package name does not match"
10
12
  assert_equal 4.6, app_info.rating, "Play rating does not match"
11
13
  assert_equal 500000, app_info.min_installs
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: play_scrape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Villena
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-09 00:00:00.000000000 Z
11
+ date: 2013-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler