本文整理汇总了Python中googleplay.GooglePlayAPI.list方法的典型用法代码示例。如果您正苦于以下问题:Python GooglePlayAPI.list方法的具体用法?Python GooglePlayAPI.list怎么用?Python GooglePlayAPI.list使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类googleplay.GooglePlayAPI
的用法示例。
在下文中一共展示了GooglePlayAPI.list方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: list
# 需要导入模块: from googleplay import GooglePlayAPI [as 别名]
# 或者: from googleplay.GooglePlayAPI import list [as 别名]
def list(cat, ctr = None, nb_results = None, offset = None):
api = GooglePlayAPI(ANDROID_ID)
api.login(GOOGLE_LOGIN, GOOGLE_PASSWORD, AUTH_TOKEN)
try:
message = api.list(cat, ctr, nb_results, offset)
except:
print "Error: HTTP 500 - one of the provided parameters is invalid"
if (ctr is None):
print SEPARATOR.join(["Subcategory ID", "Name"])
for doc in message.doc:
print SEPARATOR.join([doc.docid.encode('utf8'), doc.title.encode('utf8')])
else:
print_header_line()
doc = message.doc[0]
results = []
for c in doc.child:
results.append(get_parsed_result(c))
return results
示例2: GooglePlayAPI
# 需要导入模块: from googleplay import GooglePlayAPI [as 别名]
# 或者: from googleplay.GooglePlayAPI import list [as 别名]
cat = sys.argv[1]
ctr = None
nb_results = None
offset = None
if(len(sys.argv) >= 3):
ctr = sys.argv[2]
if(len(sys.argv) >= 4):
nb_results = sys.argv[3]
if(len(sys.argv) == 5):
offset = sys.argv[4]
api = GooglePlayAPI()
api.login(GOOGLE_LOGIN, GOOGLE_PASSWORD, AUTH_TOKEN)
try:
message = api.list(cat, ctr, nb_results, offset)
except:
print "Error: HTTP 500 - one of the provided parameters is invalid"
if(ctr is None):
print SEPARATOR.join(["Subcategory ID", "Name"])
for doc in message.doc:
print SEPARATOR.join([doc.docid.encode('utf8'), doc.title.encode('utf8')])
else:
print_header_line()
doc = message.doc[0]
for c in doc.child:
print_result_line(c)
示例3: GooglePlayAPI
# 需要导入模块: from googleplay import GooglePlayAPI [as 别名]
# 或者: from googleplay.GooglePlayAPI import list [as 别名]
if (len(sys.argv) >= 4):
nb_results = sys.argv[3]
if (len(sys.argv) == 5):
offset = sys.argv[4]
if nb_results == None:
nb_results = 20
api = GooglePlayAPI(ANDROID_ID)
api.login(GOOGLE_LOGIN, GOOGLE_PASSWORD, AUTH_TOKEN)
n = 0
while (n < nb_results):
if n == 0:
n += 20
message = api.list(cat, ctr, '20', offset)
if message == False:
print "Error: HTTP 500 - one of the provided parameters is invalid"
exit(1)
else:
time.sleep(2)
message = api.getNextPage(nextPageUrl)
if message == False:
print 'error or no more app'
break
doc = message.doc[0]
nextPageUrl = doc.containerMetadata.nextPageUrl
if (ctr is None):
print SEPARATOR.join(["Subcategory ID", "Name"])
for doc in message.doc: