google-play-scraper
Advanced tools
Comparing version 7.1.1 to 7.1.2
@@ -14,3 +14,3 @@ 'use strict'; | ||
list: require('./lib/list'), | ||
search: R.partial(require('./lib/search'), [parseList]), | ||
search: R.partial(require('./lib/search'), [parseList, appMethod]), | ||
suggest: require('./lib/suggest'), | ||
@@ -39,3 +39,3 @@ developer: require('./lib/developer'), | ||
list: require('./lib/list'), | ||
search: R.partial(require('./lib/search'), [mParseList]), | ||
search: R.partial(require('./lib/search'), [mParseList, mAppMethod]), | ||
suggest: require('./lib/suggest'), | ||
@@ -42,0 +42,0 @@ developer: require('./lib/developer'), |
'use strict'; | ||
const debug = require('debug')('google-play-scraper:app'); | ||
const request = require('./utils/request'); | ||
@@ -133,4 +134,8 @@ const queryString = require('querystring'); | ||
comments: { | ||
path: ['ds:16', 0], | ||
path: ['ds:18', 0], | ||
fun: extractComments | ||
}, | ||
editorsChoice: { | ||
path: ['ds:5', 0, 12, 15, 0], | ||
fun: Boolean | ||
} | ||
@@ -184,2 +189,5 @@ }; | ||
} | ||
debug('comments: %O', comments); | ||
return R.compose( | ||
@@ -186,0 +194,0 @@ R.take(5), |
@@ -99,3 +99,3 @@ 'use strict'; | ||
function search (getParseList, opts) { | ||
function search (getParseList, appData, opts) { | ||
return new Promise(function (resolve, reject) { | ||
@@ -126,2 +126,8 @@ if (!opts || !opts.term) { | ||
.catch(reject); | ||
}).then((results) => { | ||
if (opts.fullDetail) { | ||
// if full detail is wanted get it from the app module | ||
return Promise.all(results.map((app) => appData({ ...opts, appId: app.appId }))); | ||
} | ||
return results; | ||
}); | ||
@@ -128,0 +134,0 @@ } |
@@ -24,2 +24,10 @@ 'use strict'; | ||
}, | ||
currency: { | ||
path: [7, 0, 3, 2, 1, 0, 2], | ||
fun: (price) => price === undefined ? undefined : price.match(/([^0-9.,\s]+)/)[0] | ||
}, | ||
price: { | ||
path: [7, 0, 3, 2, 1, 0, 2], | ||
fun: (price) => price === undefined ? 0 : parseFloat(price.match(/([0-9.,]+)/)[0]) | ||
}, | ||
free: { | ||
@@ -26,0 +34,0 @@ path: [7, 0, 3, 2, 1, 0, 2], |
'use strict'; | ||
const debug = require('debug')('google-play-scraper:scriptData'); | ||
const R = require('ramda'); | ||
@@ -13,2 +14,4 @@ | ||
return function extractFields (parsedData) { | ||
debug('parsedData: %o', parsedData); | ||
return R.map((spec) => { | ||
@@ -15,0 +18,0 @@ if (R.is(Array, spec)) { |
{ | ||
"name": "google-play-scraper", | ||
"version": "7.1.1", | ||
"version": "7.1.2", | ||
"description": "scrapes app data from google play store", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "eslint . && mocha --timeout 5000 && npm audit" | ||
"test": "mocha --timeout 5000" | ||
}, | ||
@@ -9,0 +9,0 @@ "repository": { |
@@ -40,3 +40,3 @@ # google-play-scraper [![Build Status](https://secure.travis-ci.org/facundoolano/google-play-scraper.png)](http://travis-ci.org/facundoolano/google-play-scraper) | ||
gplay.app({appId: 'com.dxco.pandavszombies'}) | ||
gplay.app({appId: 'com.google.android.apps.translate'}) | ||
.then(console.log, console.log); | ||
@@ -47,15 +47,14 @@ ``` | ||
```javascript | ||
{ appId: 'com.dxco.pandavszombies', | ||
url: 'https://play.google.com/store/apps/details?id=com.dxco.pandavszombies&hl=en&gl=us' | ||
title: 'Panda vs Zombies', | ||
description: 'Panda, my friend, Panda is the answer. But not any Panda: Rocky the Panda!', | ||
descriptionHTML: 'Panda, my friend, Panda is the answer. But not any Panda: <b>Rocky the Panda!</b>', | ||
summary: 'Help Rocky the Panda warrior to fight zombie games and save the Panda kind.', | ||
installs: '10,000+', | ||
minInstalls: 10000, | ||
score: 4.5025907, | ||
{ | ||
title: 'Google Translate', | ||
description: 'Translate between 103 languages by typing\r\n...' , | ||
descriptionHTML: 'Translate between 103 languages by typing<br>...', | ||
summary: 'The world is closer than ever with over 100 languages', | ||
installs: '500,000,000+', | ||
minInstalls: 500000000, | ||
score: 4.482483, | ||
scoreText: '4.5', | ||
ratings: 386, | ||
reviews: 168, | ||
histogram: { '1': 14, '2': 11, '3': 26, '4': 51, '5': 284 }, | ||
ratings: 6811669, | ||
reviews: 1614618, | ||
histogram: { '1': 370042, '2': 145558, '3': 375720, '4': 856865, '5': 5063481 }, | ||
price: 0, | ||
@@ -67,28 +66,36 @@ free: true, | ||
IAPRange: undefined, | ||
size: '34M', | ||
androidVersion: '2.3', | ||
androidVersionText: '2.3 and up', | ||
developer: 'DxCo Games', | ||
developerId: 'DxCo+Games', | ||
developerEmail: 'dxcogames@gmail.com', | ||
developerWebsite: 'http://www.dxco-games.com/', | ||
developerAddress: undefined, | ||
genre: 'Action', | ||
genreId: 'GAME_ACTION', | ||
size: 'Varies with device', | ||
androidVersion: 'VARY', | ||
androidVersionText: 'Varies with device', | ||
developer: 'Google LLC', | ||
developerId: '5700313618786177705', | ||
developerEmail: 'translate-android-support@google.com', | ||
developerWebsite: 'http://support.google.com/translate', | ||
developerAddress: '1600 Amphitheatre Parkway, Mountain View 94043', | ||
privacyPolicy: 'http://www.google.com/policies/privacy/', | ||
developerInternalID: '5700313618786177705', | ||
genre: 'Tools', | ||
genreId: 'TOOLS', | ||
familyGenre: undefined, | ||
familyGenreId: undefined, | ||
icon: 'https://lh6.ggpht.com/5mI27oolnooL__S3ns9qAf_6TsFNExMtUAwTKz6prWCxEmVkmZZZwe3lI-ZLbMawEJh3', | ||
headerImage: 'https://lh4.ggpht.com/kKfRICvVTCikV4MLqsP0kWEth2F-I1Qt4jxMdklOdE2r8AmtrE-Umn6_WH_cGExXnjk-', | ||
screenshots: [ 'https://lh5.ggpht.com/gD8L81t4CFKI21aOVkSnfVHioInwnt0XxMMWA-dBB2aU5bk3UfxGn8Hcq_KxcM6m430'], | ||
video: 'https://www.youtube.com/embed/PFGj-W8Pe5s?ps=play&vq=large&rel=0&autohide=1&showinfo=0', | ||
videoImage: 'https://i.ytimg.com/vi/PFGj-W8Pe5s/hqdefault.jpg', | ||
contentRating: 'Mature 17+', | ||
contentRatingDescription: 'Violence, Blood and Gore', | ||
adSupported: true, | ||
released: 'Feb 27, 2015', | ||
updated: 1432677999000, | ||
version: '1.4', | ||
recentChanges: '- Added a hint system<br>- Added share option in level finished', | ||
comments: [ 'Great!', 'PvZ', 'LOL', 'Zombie killer', 'Una pasada' ] | ||
} | ||
icon: 'https://lh3.googleusercontent.com/ZrNeuKthBirZN7rrXPN1JmUbaG8ICy3kZSHt-WgSnREsJzo2txzCzjIoChlevMIQEA', | ||
headerImage: 'https://lh3.googleusercontent.com/e4Sfy0cOmqpike76V6N6n-tDVbtbmt6MxbnbkKBZ_7hPHZRfsCeZhMBZK8eFDoDa1Vf-', | ||
screenshots: [ | ||
'https://lh3.googleusercontent.com/dar060xShkqnJjWC2j_EazWBpLo28X4IUWCYXZgS2iXes7W99LkpnrvIak6vz88xFQ', | ||
'https://lh3.googleusercontent.com/VnzidUTSWK_yhpNK0uqTSfpVgow5CsZOnBdN3hIpTxODdlZg1VH1K4fEiCrdUQEZCV0', | ||
], | ||
video: undefined, | ||
videoImage: undefined, | ||
contentRating: 'Everyone', | ||
contentRatingDescription: undefined, | ||
adSupported: false, | ||
released: undefined, | ||
updated: 1576868577000, | ||
version: 'Varies with device', | ||
recentChanges: 'Improved offline translations with upgraded language downloads', | ||
comments: [], | ||
editorsChoice: true, | ||
appId: 'com.google.android.apps.translate', | ||
url: 'https://play.google.com/store/apps/details?id=com.google.android.apps.translate&hl=en&gl=us' | ||
} | ||
``` | ||
@@ -95,0 +102,0 @@ |
@@ -13,3 +13,3 @@ 'use strict'; | ||
assert.equal(app.appId, 'com.sgn.pandapop.gp'); | ||
assert.equal(app.title, 'Panda Pop! Bubble Shooter Saga & Puzzle Adventure'); | ||
assert.equal(app.title, 'Panda Pop! Bubble Shooter Saga | Blast Bubbles'); | ||
assert.equal(app.url, 'https://play.google.com/store/apps/details?id=com.sgn.pandapop.gp&hl=en&gl=us'); | ||
@@ -67,2 +67,4 @@ assertValidUrl(app.icon); | ||
assert.isString(app.recentChanges); | ||
assert.isBoolean(app.editorsChoice); | ||
}); | ||
@@ -69,0 +71,0 @@ }); |
@@ -10,3 +10,3 @@ 'use strict'; | ||
describe('List method', () => { | ||
const timeout = 15 * 1000; | ||
const timeout = 20 * 1000; | ||
@@ -34,3 +34,3 @@ it('should throw and error if the given collection does not exist', () => { | ||
.catch((error) => { | ||
assert.equal(error.message, `The collection ${collection} have no clusters`); | ||
assert.equal(error.message, `The collection ${collection} is invalid for the given category, top apps or new apps`); | ||
}); | ||
@@ -37,0 +37,0 @@ }); |
@@ -34,3 +34,3 @@ 'use strict'; | ||
gplay.search({ term: 'preregister', num: 10, fullDetail: true }) | ||
.then((apps) => apps.map(assertValidApp))); | ||
.then((apps) => apps.map(assertValidApp))).timeout(5 * 1000); | ||
@@ -37,0 +37,0 @@ it('should fetch multiple pages of distinct results', () => |
Sorry, the diff of this file is not supported yet
93545
2099
462