Last active
September 23, 2019 13:36
-
-
Save sangheestyle/ce8436cd74e59771fe9a to your computer and use it in GitHub Desktop.
Get reviews from google play
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var cheerio = require('cheerio'); | |
// Set the headers | |
var headers = { 'User-Agent': 'Wild/0.0.1' | |
, 'Content-Type': 'application/x-www-form-urlencoded' | |
} | |
// Configure the request | |
var options = { url: 'https://play.google.com/store/getreviews' | |
, method: 'POST' | |
, headers: headers | |
, form: { 'reviewType': 0 | |
, 'pageNum': 1 | |
, 'id': 'com.github.mobile' | |
, 'reviewSortOrder': 2 | |
} | |
} | |
// Start the request | |
request(options, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
var htmlString = JSON.parse(body.slice(7, -1))[2]; | |
var reviews = []; | |
$ = cheerio.load(htmlString); | |
$('.single-review').each(function(i, elem) { | |
reviews[i] = $(this).text(); | |
}); | |
console.log(reviews[0]); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dave Miyares March 7, 2015 Needs work. Can't log out or have 2nd account? I have an account at work and a personal account but have been unable to figure out how to set up two accounts or even log out. Full Review |
Finally, this API stopped working on Sept. 5th 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I used this script and for some reason, I had to ask request to use ipv6 specifically.
I added this below headers:
family: 6