forked from ilanpatao/google-playstore-reviews-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreviews.js
24 lines (24 loc) · 1.02 KB
/
reviews.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Add the click function for the go button
$('.go').click(function(){
// Get the place ID value
var appid = $('#appid').val();
if (appid == ''){
// Alert if field is blank, else continue
alert('You didn\'t enter an App ID!!');
} else {
// Call my API
$.getJSON("https://www.reviewsmaker.com/api/public/playstore/?appid=" + appid, function (data){
// Iterate through the results for this demo and display them on the page
$.each( data.reviews, function( key, value ) {
$('.results').append('<b>Review Author: </b>' + value.author + "<br>");
$('.results').append('<b>Review Author Photo: </b>' + value.authorPhoto + "<br>");
$('.results').append('<b>Review Date: </b>' + value.date + "<br>");
$('.results').append('<b>Review Rating: </b>' + value.rating + "<br>");
$('.results').append('<b>Review Text: </b>' + value.reviewText + "<hr>");
});
// Display JSON feed in our input for the demo
var json = JSON.stringify(data);
$("#jsonresults").val(json);
});
}
});