Exemple #1
0
def run(opts):
    api = merchandising(debug=opts.debug, appid=opts.appid, config_file=opts.yaml,
                        warnings=True)

    api.execute('getMostWatchedItems', {'maxResults': 3})

    if api.error():
        raise Exception(api.error())

    dump(api)
def run(opts):
    try:
        api = merchandising(debug=opts.debug, appid=opts.appid,
                            config_file=opts.yaml, warnings=True)

        api.execute('getMostWatchedItems', {'maxResults': 3})

        dump(api)
    except ConnectionError as e:
        print e
Exemple #3
0
def run(opts):
    try:
        api = merchandising(debug=opts.debug,
                            appid=opts.appid,
                            config_file=opts.yaml,
                            warnings=True)

        api.execute('getMostWatchedItems', {'maxResults': 3})

        dump(api)
    except ConnectionError as e:
        print e
	pass

def get_top_selling_products(c_id, api):
	#api.execute('getTopSellingProducts', {})
	api.execute('findItemsByCategory', {
			'categoryId' : c_id
		})
	return api.response_dict()

trade = trading(domain='api.sandbox.ebay.com',
			    appid="MatthewB-33a9-4d50-b56e-4398cece88d6",
			    devid="41d63e06-0775-4692-b656-896a9a4b39d8",
			    certid="5707a4f4-912d-4154-ac6e-d59ec72d3e75",
			    token="AgAAAA**AQAAAA**aAAAAA**wtLjUg**nY+sHZ2PrBmdj6wVnY+sEZ2PrA2dj6wFk4GhC5iCowudj6x9nY+seQ**a4ECAA**AAMAAA**bz7sLZhXIMpFSPQQ/Jjkj8XQLJ5IeP/mLRf5oCVeXBmeX91trkLKBR9adYukIDIBwqpT+RxJwGBcdY8DiOu2Va3CWquDpDcGr32NrjS3tlDJp4z09e5vvJChiWD4jAlVgu0NVZKKOSMO/Uc5rYuZQQO0JPdTGbg+r4Lut7JwVJL5IthVTTv7Ec/53E0CAbjVGFBcWvquyeLJ4GUH5sNJM7a0yeNLIv8k4O8x+Aas3igY4LfLaDAOwziFrO83+7UHU9cyf4juHhxPTPvRhGvMdBwFJihLosQ7OPh8HNOecRnnm1cK5cziwjQCqGSJJpK9fB/7EtpKOK015Et2tHF18TWyYkSrbq7TPNoGVE7kAOLK8Q/dEEdlTyJrSq4gM/aBKKHzMwkTyYfzY0Fn+/wRTz6IlExWt6NLjJf6ByzZzk7jgh98VxQMgnYxaPyZ1sNlCuLaTbt2Ui866kIZsSJr7beY2cn6+58/cZuLaJgJoaYAtW526VUGSIHB1RE88cuXfafBgeviqjC6TDUVu1w9KGdGlQFPj38RFXXDbCriIe6P1jDtdl4vt02w9uVPWBDqxnVB+7q+N6sYSrMymhMHKXNr47y06drZdAqw3/ZCx2UMdMGYjyNjbZCg7LJUx5ZRCUPgJSPFSyaTv6c8viu8LLYwaH/QSKGpC8gFkGPqbvC1zUoq5E8H26NyKAO4+9ZqFnTqZxFAv82Ik94ybqGUYkC6TSBqvEBV/OC435/sVZZ+4+/GGCfCMPCuM2AlcvqM")

merch = merchandising(domain='svcs.sandbox.ebay.com',
					  appid='MatthewB-33a9-4d50-b56e-4398cece88d6')

find = finding(domain='svcs.sandbox.ebay.com',
			   appid='MatthewB-33a9-4d50-b56e-4398cece88d6')

shop = shopping(domain='open.api.sandbox.ebay.com',
				appid='MatthewB-33a9-4d50-b56e-4398cece88d6')

#pprint.pprint(get_categories(trade))
top_selling_products = get_top_selling_products(246, find)
pprint.pprint(top_selling_products)
for product in top_selling_products.productRecommendations.product:
	print('Aggregating data for {0} ({1})'.format(product.title, product.productId.value))
	item_ids = []
	product_items = get_product_items(product.productId.value, shop)
	if product_items and product_items.ItemArray: