play_scrape 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -2
- data/lib/play_scrape/version.rb +1 -1
- data/lib/play_scrape.rb +11 -1
- data/play_scrape.gemspec +3 -0
- data/test/play_scrape_test.rb +11 -10
- metadata +31 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4eff65a54fd0c0acee5c097b6939b3860dcf485
|
4
|
+
data.tar.gz: a93abdbbbde177255bccd722aaf18a23f3eb2339
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ff45b19bc45a5732b5cacfd1ec83004e3edd20f7bd104a6c78805a8950c91d7c6598bb710a7c869cfb752a37474ec66ba26f49a2a907e3f95783685841cc45b
|
7
|
+
data.tar.gz: e212442aca5c2b36d78dd27f11e58a6764cba088f908e368e7e44bc89a89c59f4575711907ca62d451de1cc7c742257e9ce71e9e80e246fabceab30441220432
|
data/Gemfile
CHANGED
data/lib/play_scrape/version.rb
CHANGED
data/lib/play_scrape.rb
CHANGED
@@ -43,7 +43,7 @@ module PlayScrape
|
|
43
43
|
dev_links = html.css(APP_DEV_URL_CSS_PATH)
|
44
44
|
dev_url = ""
|
45
45
|
if !dev_links.empty? && dev_links.first.text.match(/Visit Developer's Website/)
|
46
|
-
dev_url = dev_links.first.attributes['href'].value.match(URL_REGEX)[1]
|
46
|
+
dev_url = dev_links.first.attributes['href'].value.match(URL_REGEX)[1]
|
47
47
|
end
|
48
48
|
|
49
49
|
app_info.app_name = name.text
|
@@ -64,4 +64,14 @@ module PlayScrape
|
|
64
64
|
def self.get_html_page_for(package_name)
|
65
65
|
res = Typhoeus.get(PLAY_URL + package_name)
|
66
66
|
end
|
67
|
+
|
68
|
+
def self.scrape_app_icon(package_name)
|
69
|
+
res = self.get_html_page_for(package_name)
|
70
|
+
if res
|
71
|
+
html = Nokogiri::HTML(res.body)
|
72
|
+
html.css(APP_ICON_CSS_PATH).first.attributes['src'].value
|
73
|
+
else
|
74
|
+
nil
|
75
|
+
end
|
76
|
+
end
|
67
77
|
end
|
data/play_scrape.gemspec
CHANGED
data/test/play_scrape_test.rb
CHANGED
@@ -1,21 +1,22 @@
|
|
1
|
-
require '
|
2
|
-
require 'play_scrape'
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'play_scrape'
|
3
3
|
|
4
|
-
class PlayScrapeTest <
|
4
|
+
class PlayScrapeTest < MiniTest::Unit::TestCase
|
5
5
|
TEST_PACKAGE = 'com.ea.game.fifa14_na'
|
6
6
|
def test_scraping_app_information
|
7
7
|
app_info = PlayScrape.scrape_app_info(TEST_PACKAGE)
|
8
|
-
puts app_info.version
|
9
|
-
|
10
|
-
|
11
8
|
assert_equal 'FIFA 14 by EA SPORTS™', app_info.app_name
|
12
9
|
assert_equal 'com.ea.game.fifa14_na', app_info.package_name, "Package name does not match"
|
13
|
-
assert_equal 4.
|
10
|
+
assert_equal 4.5, app_info.rating, "Play rating does not match"
|
14
11
|
assert_equal 1000000, app_info.min_installs
|
15
12
|
assert_equal 5000000, app_info.max_installs
|
16
|
-
assert_operator
|
17
|
-
assert_match '
|
13
|
+
assert_operator 194885, :<=, app_info.num_ratings
|
14
|
+
assert_match 'Now with', app_info.description, "Description doesn't match"
|
18
15
|
assert_match 'http://help.ea.com', app_info.dev_url, "Developer url doesn't match"
|
19
|
-
assert_equal '1.3.
|
16
|
+
assert_equal '1.3.6', app_info.version
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_getting_icon
|
20
|
+
assert_equal "https://lh5.ggpht.com/chWzyD9s4aOVlOekaQwnkVXnYOy_KQu9vZFaVuB_C2jHfORe9HBcSEk3_dfjZkmwCTY=w300", PlayScrape.scrape_app_icon(TEST_PACKAGE)
|
20
21
|
end
|
21
22
|
end
|
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.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Villena
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,34 @@ dependencies:
|
|
38
38
|
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.6.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.6.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: typhoeus
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.6.6
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.6.6
|
41
69
|
description: Basic scraping of the Google PlayStore
|
42
70
|
email:
|
43
71
|
- mvillena@cmu.edu
|
@@ -76,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
104
|
version: '0'
|
77
105
|
requirements: []
|
78
106
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.2.1
|
80
108
|
signing_key:
|
81
109
|
specification_version: 4
|
82
110
|
summary: It can scrape the play store
|