def run(opts): try: shopping = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, warnings=False) shopping.execute('FindPopularItems', {'QueryKeywords': 'Python'}) nodes = shopping.response_dom().getElementsByTagName('ItemID') itemIds = [getNodeText(n) for n in nodes] api = FindItem(debug=opts.debug, consumer_id=opts.consumer_id, config_file=opts.yaml) records = api.find_items_by_ids(itemIds) for r in records: print("ID(%s) TITLE(%s)" % (r['ITEM_ID'], r['TITLE'][:35])) dump(api) except ConnectionError as e: print e
def run(opts): api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, warnings=True) print("Shopping samples for SDK version %s" % ebaysdk.get_version()) try: api.execute('FindPopularItems', {'QueryKeywords': 'Python'}) if api.response_content(): print("Call Success: %s in length" % len(api.response_content())) print("Response code: %s" % api.response_code()) print("Response DOM: %s" % api.response_dom()) dictstr = "%s" % api.response_dict() print("Response dictionary: %s..." % dictstr[:50]) print("Matching Titles:") for item in api.response_dict().ItemArray.Item: print(item.Title) except ConnectionError as e: print e