improved review() response + added in test.py

Signed-off-by: Domenico Iezzi <domenico.iezzi.201@gmail.com>
This commit is contained in:
Domenico Iezzi 2017-10-08 21:25:04 +02:00
parent 052afcbb0b
commit 0cda029a52
2 changed files with 15 additions and 2 deletions

View File

@ -407,8 +407,15 @@ class GooglePlayAPI(object):
path += "&o=%d" % int(offset) path += "&o=%d" % int(offset)
if(filterByDevice): if(filterByDevice):
path += "&dfil=1" path += "&dfil=1"
message = self.executeRequestApi2(path) data = self.executeRequestApi2(path)
return message.payload.reviewResponse reviews = [rev for rev in data.payload.reviewResponse.getResponse.review]
return [{ 'documentVersion': r.documentVersion,
'timestampMsec': r.timestampMsec,
'starRating': r.starRating,
'comment': r.comment,
'commentId': r.commentId,
'author': r.author2.name } for r in reviews]
def delivery(self, packageName, versionCode, def delivery(self, packageName, versionCode,
offerType=1, downloadToken=None, progress_bar=False): offerType=1, downloadToken=None, progress_bar=False):

View File

@ -76,6 +76,12 @@ print('\nGetting details for %s\n' % testApps[0])
details = server.details(testApps[0]) details = server.details(testApps[0])
print(details) print(details)
# REVIEWS
print('\nGetting reviews for %s\n' % testApps[0])
revs = server.reviews(testApps[0])
for r in revs:
print(r['comment'])
# BROWSE # BROWSE
print('\nBrowse play store categories\n') print('\nBrowse play store categories\n')