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

        response = api.execute("getMostWatchedItems", {"maxResults": 4})

        dump(api)
    except ConnectionError as e:
        print(e)
        print(e.response.dict())
Beispiel #2
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
def run(opts):
    try:
        api = merchandising(debug=opts.debug,
                            appid=opts.appid,
                            domain=opts.domain,
                            config_file=opts.yaml,
                            warnings=True)

        response = api.execute('getMostWatchedItems', {'maxResults': 4})

        dump(api)
    except ConnectionError as e:
        print(e)
        print(e.response.dict())
Beispiel #4
0
    def get_top_watched_items(country_id):
        try:
            api = merchandising(siteid=country_id,
                                appid=Ebay.KARL_ID,
                                config_file=None,
                                warnings=True)
            api.execute('getMostWatchedItems', {
                'maxResults': 10,
            })

            return api.response_json()

        except ConnectionError as e:
            print(e)
            print(e.response.dict())
def merch(args):
    try:
        api = merchandising(debug=args.debug,
                            appid=app_id,
                            siteid=site_id,
                            config_file=None,
                            warnings=True)

        reply = api.execute('getTopSellingProducts', {'maxResults': 2})

        dump(api)

        if api.response.reply.has_key('productRecommendations'):
            items = api.response.reply.productRecommendations

        if type(items) != list:
            items = [items]

        for m in items:
            print("%s" % (m.product))

    except ConnectionError as e:
        print(e)
        print(e.response.dict())