How to use the google-play-scraper.app function in google-play-scraper

To help you get started, we’ve selected a few google-play-scraper examples, based on popular ways it is used in public projects.

github TradeMe / ReviewMe / googleplayreviews.js View on Github external
exports.startReview = function (config, first_run) {
    var appInformation = {};

    //scrape Google Play for app information first
    playScraper.app({appId: config.appId})
        .then(function (appData, error) {
            if (error) {
                return console.error("ERROR: [" + config.appId + "] Could not scrape Google Play, " + error);
            }

            appInformation.appName = appData.title;
            appInformation.appIcon = appData.icon;

            exports.fetchGooglePlayReviews(config, appInformation, function (reviews) {
                // If we don't have any published reviews, then treat this as a baseline fetch, we won't post any
                // reviews to slack, but new ones from now will be posted
                if (first_run) {
                    var reviewLength = reviews.length;

                    for (var i = 0; i < reviewLength; i++) {
                        var initialReview = reviews[i];
github timoa / app-stores-prometheus-exporter / src / lib / prometheus.js View on Github external
itunes.app({
        appId: opt.appId,
        country: opt.country, // TODO: Support more countries
      })
        .then((data) => {
          setMetrics(store, opt.country, data) // TODO: Support more countries
            .then(resolve)
            .catch(reject);
        })
        .catch((err) => {
          reject(new Error(`Itunes Scraper error for the app "${opt.appId}" (${opt.country}): ${err.message}`));
        });
    }

    if (store === 'gplay') {
      gplay.app({
        appId: opt.appId,
        country: opt.country, // TODO: Support more countries
      })
        .then((data) => {
          setMetrics(store, opt.country, data) // TODO: Support more countries
            .then(resolve)
            .catch(reject);
        })
        .catch((err) => {
          reject(new Error(`Google Play Scraper error for the app "${opt.appId}"" (${opt.country}): ${err.message}`));
        });
    }
  });
}
github facundoolano / google-play-api / lib / index.js View on Github external
router.get('/apps/:appId', function (req, res, next) {
  const opts = Object.assign({appId: req.params.appId}, req.query);
  gplay.app(opts)
    .then(cleanUrls(req))
    .then(res.json.bind(res))
    .catch(next);
});