本文整理匯總了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: