market_bot 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +14 -0
- data/Rakefile +6 -4
- data/lib/market_bot/android/app.rb +7 -2
- data/lib/market_bot/version.rb +1 -1
- data/spec/market_bot/android/app_spec.rb +31 -27
- data/spec/market_bot/android/data/app_1.txt +33 -52
- data/spec/market_bot/android/data/app_2.txt +33 -52
- data/spec/market_bot/android/data/app_3.txt +33 -52
- data/spec/market_bot/android/data/leaderboard-apps_editors_choice.txt +31 -50
- data/spec/market_bot/android/data/leaderboard-apps_topselling_paid-page1.txt +31 -50
- data/spec/market_bot/android/data/leaderboard-apps_topselling_paid-page2.txt +31 -50
- data/spec/market_bot/android/data/leaderboard-apps_topselling_paid-page3.txt +31 -50
- data/spec/market_bot/android/data/leaderboard-apps_topselling_paid-page4.txt +31 -50
- data/spec/market_bot/android/leaderboard_spec.rb +7 -7
- data/spec/spec_helper.rb +4 -0
- metadata +11 -12
- data/.ruby-version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2d8f2fb0e5c926ec1464d3278f72c182376519b
|
4
|
+
data.tar.gz: 82d2906d015c7cea01676a8ae14922fba912a7f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0701c2f3a9af7902cfd12985988b0fee466dd3e26e6a344592d42ef16d89575f79500537be00d535381767ffd87a539688eebd815ba616417c7361bbd50753b2
|
7
|
+
data.tar.gz: 0eba7c4aaad09fa68108a8176468ac0d3b33274d7009ac78e44947a3cd946fdc120f565071523dfb1409e2e994ef859c0db452194c7cf7053e3a6dd5a0dcd3b1
|
data/README.markdown
CHANGED
@@ -45,6 +45,20 @@ The app, leaderboard, and app search features are known to work, but the develop
|
|
45
45
|
developer = MarketBot::Android::Developer.new('Zynga')
|
46
46
|
developer.update
|
47
47
|
puts "Results found: #{developer.results.count}"
|
48
|
+
|
49
|
+
# Print the rating for an app.
|
50
|
+
puts MarketBot::Android::App.new('com.king.candycrushsaga').update.rating
|
51
|
+
|
52
|
+
# Check if an app exists and has a title.
|
53
|
+
def app_exists?(app_id)
|
54
|
+
begin
|
55
|
+
return !!MarketBot::Android::App.new(app_id).update.title
|
56
|
+
rescue
|
57
|
+
return false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
app_exists?('com.king.candycrushsaga') # Return's true.
|
61
|
+
app_exists?('com.some.fake.app.that.does.not.exist') # Return's false.
|
48
62
|
|
49
63
|
## Advanced API Examples
|
50
64
|
|
data/Rakefile
CHANGED
@@ -22,6 +22,8 @@ end
|
|
22
22
|
|
23
23
|
namespace :spec do
|
24
24
|
namespace :data do
|
25
|
+
require 'typhoeus'
|
26
|
+
|
25
27
|
def download(url, save_path)
|
26
28
|
resp = Typhoeus::Request.get(url)
|
27
29
|
File.open(save_path, "w") do |file|
|
@@ -41,16 +43,16 @@ namespace :spec do
|
|
41
43
|
download('https://play.google.com/store/apps/details?id=com.mg.android',
|
42
44
|
File.join(File.dirname(__FILE__), 'spec', 'market_bot', 'android', 'data', 'app_3.txt'))
|
43
45
|
|
44
|
-
download('https://play.google.com/store/apps/category/
|
46
|
+
download('https://play.google.com/store/apps/category/GAME_ARCADE/collection/topselling_paid?num=24',
|
45
47
|
File.join(File.dirname(__FILE__), 'spec', 'market_bot', 'android', 'data', 'leaderboard-apps_topselling_paid-page1.txt'))
|
46
48
|
|
47
|
-
download('https://play.google.com/store/apps/category/
|
49
|
+
download('https://play.google.com/store/apps/category/GAME_ARCADE/collection/topselling_paid?start=24&num=24',
|
48
50
|
File.join(File.dirname(__FILE__), 'spec', 'market_bot', 'android', 'data', 'leaderboard-apps_topselling_paid-page2.txt'))
|
49
51
|
|
50
|
-
download('https://play.google.com/store/apps/category/
|
52
|
+
download('https://play.google.com/store/apps/category/GAME_ARCADE/collection/topselling_paid?start=48&num=24',
|
51
53
|
File.join(File.dirname(__FILE__), 'spec', 'market_bot', 'android', 'data', 'leaderboard-apps_topselling_paid-page3.txt'))
|
52
54
|
|
53
|
-
download('https://play.google.com/store/apps/category/
|
55
|
+
download('https://play.google.com/store/apps/category/GAME_ARCADE/collection/topselling_paid?start=96&num=24',
|
54
56
|
File.join(File.dirname(__FILE__), 'spec', 'market_bot', 'android', 'data', 'leaderboard-apps_topselling_paid-page4.txt'))
|
55
57
|
|
56
58
|
download('https://play.google.com/store/apps/collection/editors_choice',
|
@@ -7,7 +7,7 @@ module MarketBot
|
|
7
7
|
:votes, :developer, :more_from_developer, :users_also_installed,
|
8
8
|
:related, :banner_icon_url, :banner_image_url, :website_url, :email,
|
9
9
|
:youtube_video_ids, :screenshot_urls, :whats_new, :permissions,
|
10
|
-
:rating_distribution, :html]
|
10
|
+
:rating_distribution, :html, :category_url]
|
11
11
|
|
12
12
|
attr_reader :app_id
|
13
13
|
attr_reader *MARKET_ATTRIBUTES
|
@@ -56,7 +56,12 @@ module MarketBot
|
|
56
56
|
node = doc.xpath("//meta[@itemprop='price']").first
|
57
57
|
result[:price] = node[:content].strip rescue 'Free'
|
58
58
|
|
59
|
-
|
59
|
+
category_div = doc.css('.category').first
|
60
|
+
result[:category] = category_div.text.strip rescue ''
|
61
|
+
cat_link = category_div["href"]
|
62
|
+
path, cat_name = File.split(cat_link)
|
63
|
+
result[:category_url] = cat_name
|
64
|
+
|
60
65
|
result[:description] = doc.xpath("//div[@itemprop='description']").first.inner_html.strip
|
61
66
|
result[:title] = doc.xpath("//div[@itemprop='name']").first.text.strip
|
62
67
|
|
data/lib/market_bot/version.rb
CHANGED
@@ -14,16 +14,17 @@ def check_getters(app)
|
|
14
14
|
app.updated.should == 'August 26, 2011'
|
15
15
|
app.current_version.should == '1.0'
|
16
16
|
app.requires_android.should == '2.2 and up'
|
17
|
-
app.category.should == 'Arcade
|
17
|
+
app.category.should == 'Arcade'
|
18
|
+
app.category_url.should == 'GAME_ARCADE'
|
18
19
|
app.installs.should == '500 - 1,000'
|
19
20
|
app.size.should == '9.0M'
|
20
|
-
app.price.should == '
|
21
|
+
app.price.should == '0'
|
21
22
|
app.content_rating.should == 'Everyone'
|
22
23
|
app.description.should =~ /^<div.*?>An action-packed blend of split-second skill and luck-based gameplay!/
|
23
|
-
app.votes.should == '
|
24
|
+
app.votes.should == '8'
|
24
25
|
app.more_from_developer.should == [{:app_id=>"com.bluefroggaming.ghost_chicken"}]
|
25
|
-
app.users_also_installed.should == [{:app_id=>"
|
26
|
-
app.related.should == [{:app_id=>"
|
26
|
+
app.users_also_installed.should == [{:app_id=>"stg.boomonline"}, {:app_id=>"vn.ibit.mazecity"}, {:app_id=>"net.simplexcode.bababoom"}]
|
27
|
+
app.related.should == [{:app_id=>"stg.boomonline"}, {:app_id=>"vn.ibit.mazecity"}, {:app_id=>"net.simplexcode.bababoom"}]
|
27
28
|
app.banner_icon_url.should == 'https://lh3.ggpht.com/e6QqjMM9K__moeCm2C5HRb0SmGX0XqzhnhiE1MUx8MdNVdQbQW9rhFX_qmtbtBxHAa0=w300'
|
28
29
|
app.banner_image_url.should == 'https://lh3.ggpht.com/e6QqjMM9K__moeCm2C5HRb0SmGX0XqzhnhiE1MUx8MdNVdQbQW9rhFX_qmtbtBxHAa0=w300'
|
29
30
|
app.website_url.should == 'http://bluefroggaming.com'
|
@@ -35,7 +36,7 @@ def check_getters(app)
|
|
35
36
|
# Stubbing out for now, can't find them in the redesigned page.
|
36
37
|
app.permissions.should == []
|
37
38
|
|
38
|
-
app.rating_distribution.should == {5=>
|
39
|
+
app.rating_distribution.should == {5=>7, 4=>0, 3=>0, 2=>1, 1=>0}
|
39
40
|
app.html.class.should == String
|
40
41
|
end
|
41
42
|
end
|
@@ -67,13 +68,14 @@ describe 'App' do
|
|
67
68
|
result[:updated].should == 'August 26, 2011'
|
68
69
|
result[:current_version].should == '1.0'
|
69
70
|
result[:requires_android].should == '2.2 and up'
|
70
|
-
result[:category].should == 'Arcade
|
71
|
+
result[:category].should == 'Arcade'
|
72
|
+
result[:category_url].should == 'GAME_ARCADE'
|
71
73
|
result[:installs].should == '500 - 1,000'
|
72
74
|
result[:size].should == '9.0M'
|
73
|
-
result[:price].should == '
|
75
|
+
result[:price].should == '0'
|
74
76
|
result[:content_rating].should == 'Everyone'
|
75
77
|
result[:description].should =~ /An action-packed blend of split-second/
|
76
|
-
result[:votes].should == '
|
78
|
+
result[:votes].should == '8'
|
77
79
|
result[:developer].should == 'Blue Frog Gaming'
|
78
80
|
result[:banner_icon_url].should == 'https://lh3.ggpht.com/e6QqjMM9K__moeCm2C5HRb0SmGX0XqzhnhiE1MUx8MdNVdQbQW9rhFX_qmtbtBxHAa0=w300'
|
79
81
|
result[:website_url].should == 'http://bluefroggaming.com'
|
@@ -84,7 +86,7 @@ describe 'App' do
|
|
84
86
|
#result[:permissions].should == [{:security=>"dangerous", :group=>"Network communication", :description=>"full Internet access", :description_full=>"Allows the app to create network sockets."}, {:security=>"dangerous", :group=>"Phone calls", :description=>"read phone state and identity", :description_full=>"Allows the app to access the phone features of the device. An app with this permission can determine the phone number and serial number of this phone, whether a call is active, the number that call is connected to and the like."}, {:security=>"safe", :group=>"Network communication", :description=>"view network state", :description_full=>"Allows the app to view the state of all networks."}]
|
85
87
|
# Stubbing out for now, can't find them in the redesigned page.
|
86
88
|
result[:permissions].should == []
|
87
|
-
result[:rating_distribution].should == {5=>
|
89
|
+
result[:rating_distribution].should == {5=>7, 4=>0, 3=>0, 2=>1, 1=>0}
|
88
90
|
result[:html].should == test_src_data
|
89
91
|
|
90
92
|
result
|
@@ -94,29 +96,30 @@ describe 'App' do
|
|
94
96
|
result = App.parse(test_src_data2)
|
95
97
|
|
96
98
|
result[:title].should == 'Evernote'
|
97
|
-
result[:rating].should == '4.
|
98
|
-
result[:updated].should == '
|
99
|
+
result[:rating].should == '4.6'
|
100
|
+
result[:updated].should == 'June 26, 2014'
|
99
101
|
result[:current_version].should == 'Varies with device'
|
100
102
|
result[:requires_android].should == 'Varies with device'
|
101
103
|
result[:category].should == 'Productivity'
|
104
|
+
result[:category_url].should == 'PRODUCTIVITY'
|
102
105
|
result[:size].should == 'Varies with device'
|
103
|
-
result[:price].should == '
|
106
|
+
result[:price].should == '0'
|
104
107
|
result[:content_rating].should == 'Low Maturity'
|
105
108
|
result[:description].should =~ /New York Times/
|
106
|
-
result[:votes].should == '
|
109
|
+
result[:votes].should == '987819'
|
107
110
|
result[:developer].should == 'Evernote Corporation'
|
108
|
-
result[:installs].should == '
|
111
|
+
result[:installs].should == '50,000,000 - 100,000,000'
|
109
112
|
result[:banner_icon_url].should == 'https://lh3.ggpht.com/si0cgkp2rkVX5JhhBYrtZ4cy2I1hZcrx8aiz-v8MjvPykfhT7-YAM2B8MNi0OCF9AQ=w300'
|
110
113
|
result[:banner_image_url].should == 'https://lh3.ggpht.com/si0cgkp2rkVX5JhhBYrtZ4cy2I1hZcrx8aiz-v8MjvPykfhT7-YAM2B8MNi0OCF9AQ=w300'
|
111
114
|
result[:website_url].should == 'http://evernote.com/privacy/'
|
112
115
|
result[:email].should == nil
|
113
116
|
result[:youtube_video_ids].should == ['Ag_IGEgAa9M']
|
114
|
-
result[:screenshot_urls].should == ["https://lh3.ggpht.com
|
117
|
+
result[:screenshot_urls].should == ["https://lh3.ggpht.com/-uAQsDoqxCpENdxqX9PJ8uZMHVno-q_j7ys2t0u7ExRh9T5Lv839rIkGSrMNQ37SLX84=h310", "https://lh6.ggpht.com/nkot7aK-feeHWYMVFVesncWpwlc0u1qbs0XTrnpdp0agBSjIcngVBWjdYac02I48pA=h310", "https://lh5.ggpht.com/rodyOgoE6ckOEeWWqwMmkc8A_gQAdbPoUWxHsmjhRQh3pVDzaMOw4INtVqWCKetPq0o=h310", "https://lh4.ggpht.com/1taR7CXMM0NQxKFu_dkcfZoRKRm2TxpRubI2pUkT2rDuxcKp1QNAUgujIVQsAVtkL1w=h310", "https://lh3.ggpht.com/pSDOKGKQcC1GdEwcwkg8GR_s9vGkmsAis2cjgiioZRXh4DFjr0OWmwywEuQcwCo5mc8=h310", "https://lh4.ggpht.com/fCsV4Ngg32sUbr95rX2_eL-1OnW19cqsRdXmYhAJYYipS4oex2Ea8cwayUg_r1nJQy4=h310", "https://lh6.ggpht.com/kMxyXDioJ0g3Jpo8KnbUrts5XoIXHN_MKIRGzUzOgX8iW7ej_4r_L_0wWHGpFpx9jQ=h310", "https://lh4.ggpht.com/IG9xzoi6R6f0DlqKUHZWe3xTovKhzLZQWLpzU73s2D6nDRFrSrRtFKIOST5K8ksPgw=h310", "https://lh4.ggpht.com/RAVDjjjs_A0encFlwkAHiSn0afYnjmSgRx_p3WYPh9gvxJct3SoxiKE0F-sQNBnCaA=h310", "https://lh3.ggpht.com/zk3wB45O90a7qWe8LaXOpCJckFpS-Ukkih38Icq9SCry5pvmJfq0qpocuxZxXSYRJg=h310", "https://lh3.ggpht.com/xtSyEJsSKSMSjiVmtfZIQGxFI6T690aKJy4e6MhVGiFzOk44YCFcLkkhMDWjSqi3n_E=h310", "https://lh4.ggpht.com/2SMJhH9xCIpEvTlTevsMZI9xE2L_mWs79g1KyuGJ4kZ4VLP2NTu9UwKTndx6cRUkcz4=h310", "https://lh4.ggpht.com/a2dX7OdrMonXVW1jnBX1MAx6GlCW3DMwJSRPp787QQZYL_Nj0XmfTvWVr7OA0j4O3Q=h310", "https://lh5.ggpht.com/g9J-W-kAVR-FoSmuU3cPJYgiLLXJO3p9gbp-CL1upicwlyoyD3RPvGXhmExSNQIWIA=h310", "https://lh5.ggpht.com/EoPwnSqrjemPIv2TpBYY5GFFa6pQgVZZbiS7xFUbJgzND9WnvaNzRk9cE67NB08ERq8=h310"]
|
115
118
|
result[:whats_new].should =~ /What's New/
|
116
119
|
#result[:permissions].should == [{:security=>"dangerous", :group=>"Hardware controls", :description=>"record audio", :description_full=>"Allows the app to access the audio record path."}, {:security=>"dangerous", :group=>"Hardware controls", :description=>"take pictures and videos", :description_full=>"Allows the app to take pictures and videos with the camera. This allows the app at any time to collect images the camera is seeing."}, {:security=>"dangerous", :group=>"Your location", :description=>"coarse (network-based) location", :description_full=>"Access coarse location sources such as the cellular network database to determine an approximate tablet location, where available. Malicious apps may use this to determine approximately where you are. Access coarse location sources such as the cellular network database to determine an approximate phone location, where available. Malicious apps may use this to determine approximately where you are."}, {:security=>"dangerous", :group=>"Your location", :description=>"fine (GPS) location", :description_full=>"Access fine location sources such as the Global Positioning System on the tablet, where available. Malicious apps may use this to determine where you are, and may consume additional battery power. Access fine location sources such as the Global Positioning System on the phone, where available. Malicious apps may use this to determine where you are, and may consume additional battery power."}, {:security=>"dangerous", :group=>"Network communication", :description=>"full Internet access", :description_full=>"Allows the app to create network sockets."}, {:security=>"dangerous", :group=>"Your personal information", :description=>"read contact data", :description_full=>"Allows the app to read all of the contact (address) data stored on your tablet. Malicious apps may use this to send your data to other people. Allows the app to read all of the contact (address) data stored on your phone. Malicious apps may use this to send your data to other people."}, {:security=>"dangerous", :group=>"Your personal information", :description=>"read sensitive log data", :description_full=>"Allows the app to read from the system's various log files. This allows it to discover general information about what you are doing with the tablet, potentially including personal or private information. Allows the app to read from the system's various log files. This allows it to discover general information about what you are doing with the phone, potentially including personal or private information."}, {:security=>"dangerous", :group=>"Your personal information", :description=>"read calendar events plus confidential information", :description_full=>"Allows the app to read all calendar events stored on your tablet, including those of friends or coworkers. Malicious apps may extract personal information from these calendars without the owners' knowledge. Allows the app to read all calendar events stored on your phone, including those of friends or coworkers. Malicious apps may extract personal information from these calendars without the owners' knowledge."}, {:security=>"dangerous", :group=>"Phone calls", :description=>"read phone state and identity", :description_full=>"Allows the app to access the phone features of the device. An app with this permission can determine the phone number and serial number of this phone, whether a call is active, the number that call is connected to and the like."}, {:security=>"dangerous", :group=>"Storage", :description=>"modify/delete USB storage contents modify/delete SD card contents", :description_full=>"Allows the app to write to the USB storage. Allows the app to write to the SD card."}, {:security=>"dangerous", :group=>"System tools", :description=>"prevent tablet from sleeping prevent phone from sleeping", :description_full=>"Allows the app to prevent the tablet from going to sleep. Allows the app to prevent the phone from going to sleep."}, {:security=>"safe", :group=>"Your accounts", :description=>"discover known accounts", :description_full=>"Allows the app to get the list of accounts known by the tablet. Allows the app to get the list of accounts known by the phone."}, {:security=>"safe", :group=>"Hardware controls", :description=>"control vibrator", :description_full=>"Allows the app to control the vibrator."}, {:security=>"safe", :group=>"Network communication", :description=>"view network state", :description_full=>"Allows the app to view the state of all networks."}, {:security=>"safe", :group=>"Network communication", :description=>"view Wi-Fi state", :description_full=>"Allows the app to view the information about the state of Wi-Fi."}, {:security=>"safe", :group=>"Default", :description=>"Market billing service", :description_full=>"Allows the user to purchase items through Market from within this application"}]
|
117
120
|
# Stubbing out for now, can't find them in the redesigned page.
|
118
121
|
result[:permissions].should == []
|
119
|
-
result[:rating_distribution].should == {5=>
|
122
|
+
result[:rating_distribution].should == {5=>731924, 4=>199038, 3=>31885, 2=>9166, 1=>15590}
|
120
123
|
result[:html].should == test_src_data2
|
121
124
|
end
|
122
125
|
|
@@ -124,27 +127,28 @@ describe 'App' do
|
|
124
127
|
result = App.parse(test_src_data3)
|
125
128
|
|
126
129
|
result[:title].should == 'WeatherPro'
|
127
|
-
result[:updated].should == '
|
128
|
-
result[:current_version].should == '3.
|
130
|
+
result[:updated].should == 'May 13, 2014'
|
131
|
+
result[:current_version].should == '3.4.2'
|
129
132
|
result[:requires_android].should == '2.1 and up'
|
130
133
|
result[:category].should == 'Weather'
|
131
|
-
result[:
|
132
|
-
result[:
|
134
|
+
result[:category_url].should == 'WEATHER'
|
135
|
+
result[:size].should == '8.7M'
|
136
|
+
result[:price].should == '$0.99'
|
133
137
|
result[:content_rating].should == 'Low Maturity'
|
134
|
-
result[:description].should =~
|
138
|
+
result[:description].should =~ /^.*Plan your summer with WeatherPro! With the holidays just starting/
|
135
139
|
result[:developer].should == 'MeteoGroup'
|
136
140
|
result[:rating].should == "4.4"
|
137
|
-
result[:votes].should == "
|
138
|
-
result[:banner_icon_url].should == 'https://
|
139
|
-
result[:banner_image_url].should == 'https://
|
141
|
+
result[:votes].should == "28469"
|
142
|
+
result[:banner_icon_url].should == 'https://lh5.ggpht.com/gEwuqrqo9Hu2qRNfBi8bLs0XByBQEmhvBhyNXJLuPmrT47GNfljir8ddam-Plzhovrg=w300'
|
143
|
+
result[:banner_image_url].should == 'https://lh5.ggpht.com/gEwuqrqo9Hu2qRNfBi8bLs0XByBQEmhvBhyNXJLuPmrT47GNfljir8ddam-Plzhovrg=w300'
|
140
144
|
result[:website_url].should == 'http://www.weatherpro.eu/privacy-policy.html'
|
141
145
|
result[:email].should == 'support@android.weatherpro.de'
|
142
146
|
result[:youtube_video_ids].should == []
|
143
|
-
result[:whats_new].should =~ /
|
147
|
+
result[:whats_new].should =~ /Some minor improvements have been made to keep the app up-to-date/
|
144
148
|
#result[:permissions].should == [{:security=>"dangerous", :group=>"Your location", :description=>"fine (GPS) location", :description_full=>"Access fine location sources such as the Global Positioning System on the tablet, where available. Malicious apps may use this to determine where you are, and may consume additional battery power. Access fine location sources such as the Global Positioning System on the phone, where available. Malicious apps may use this to determine where you are, and may consume additional battery power."}, {:security=>"dangerous", :group=>"Network communication", :description=>"full Internet access", :description_full=>"Allows the app to create network sockets."}, {:security=>"safe", :group=>"Network communication", :description=>"view network state", :description_full=>"Allows the app to view the state of all networks."}]
|
145
149
|
# Stubbing out for now, can't find them in the redesigned page.
|
146
150
|
result[:permissions].should == []
|
147
|
-
result[:rating_distribution].should == {5=>
|
151
|
+
result[:rating_distribution].should == {5=>17860, 4=>7270, 3=>1476, 2=>635, 1=>1217}
|
148
152
|
result[:html].should == test_src_data3
|
149
153
|
end
|
150
154
|
|