def getCategories(self): req = market_proto.CategoriesRequest() request = market_proto.Request() request.requestgroup.add(categoriesRequest=req) response = self.execute(request) retlist = [] for rg in response.responsegroup: if rg.HasField("categoriesResponse"): for cat in rg.categoriesResponse.categories: retlist.append(self._toDict(cat)) return retlist
def getSubCategories(self, apptype): req = market_proto.SubCategoriesRequest() req.appType = apptype request = market_proto.Request() request.requestgroup.add(subCategoriesRequest=req) response = self.execute(request) retlist = [] for rg in response.responsegroup: if rg.HasField("subCategoriesResponse"): for cat in rg.subCategoriesResponse.category: retlist.append(self._toDict(cat)) return retlist
def getComments(self, appid, startIndex=0, entriesCount=10): req = market_proto.CommentsRequest() req.appId = appid req.startIndex = startIndex req.entriesCount = entriesCount request = market_proto.Request() request.requestgroup.add(commentsRequest=req) response = self.execute(request) retlist = [] for rg in response.responsegroup: if rg.HasField("commentsResponse"): for comment in rg.commentsResponse.comments: retlist.append(self._toDict(comment)) return retlist
def getImage(self, appid, imageid="0", imagetype=market_proto.GetImageRequest.SCREENSHOT): req = market_proto.GetImageRequest() req.appId = appid req.imageId = imageid req.imageUsage = imagetype request = market_proto.Request() request.requestgroup.add(imageRequest=req) response = self.execute(request) for rg in response.responsegroup: if rg.HasField("imageResponse"): return rg.imageResponse.imageData
def searchApp(self, query, startIndex=0, entriesCount=10, extendedInfo=True): appsreq = market_proto.AppsRequest() appsreq.query = query appsreq.startIndex = startIndex appsreq.entriesCount = entriesCount appsreq.withExtendedInfo = extendedInfo request = market_proto.Request() request.requestgroup.add(appsRequest=appsreq) response = self.execute(request) retlist = [] for rg in response.responsegroup: if rg.HasField("appsResponse"): for app in rg.appsResponse.app: retlist.append(self._toDict(app)) return retlist