def print_result_line(c): global config if config == None: config = GooglePlayAPI.read_config() l = [ str_compat(c.title), c.docid, str_compat(c.creator), len(c.annotations.badgeForCreator), # Is Super Developer? c.offer[0].formattedAmount, c.offer[0].offerType, c.details.appDetails.versionCode, sizeof_fmt(c.details.appDetails.installationSize), "%.2f" % c.aggregateRating.starRating, c.details.appDetails.numDownloads] print(*l, sep=config['SEPARATOR'])
def print_header_line(): global config if config == None: config = GooglePlayAPI.read_config() l = [ "Title", "Package name", "Creator", "Super Dev", "Price", "Offer Type", "Version Code", "Size", "Rating", "Num Downloads", ] print(*l, sep=config['SEPARATOR'])
sys.exit(0) 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] # read config from config.py config = GooglePlayAPI.read_config() # connect to GooglePlayStore api = GooglePlayAPI(config['ANDROID_ID']) api.login(config['GOOGLE_LOGIN'], config['GOOGLE_PASSWORD'], config['AUTH_TOKEN']) try: message = api.list(cat, ctr, nb_results, offset) except: print("Error: HTTP 500 - one of the provided parameters is invalid") sys.exit(1) if (ctr is None): print("Subcategory ID", "Name", sep=config['SEPARATOR']) for doc in message.doc:
sys.exit(0) 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] # read config from config.py config = GooglePlayAPI.read_config() # connect to GooglePlayStore api = GooglePlayAPI(config['ANDROID_ID']) api.login(config['GOOGLE_LOGIN'], config['GOOGLE_PASSWORD'], config['AUTH_TOKEN']) try: message = api.list(cat, ctr, nb_results, offset) except: print("Error: HTTP 500 - one of the provided parameters is invalid") sys.exit(1) if (ctr is None): print("Subcategory ID", "Name", sep=config['SEPARATOR']) for doc in message.doc: print(helpers.str_compat(doc.docid), helpers.str_compat(doc.title), sep=config['SEPARATOR'])