コード例 #1
0
ファイル: parallel.py プロジェクト: alex-min/ebaysdk-python
def run(opts):

    p = parallel()
    apis = []

    api1 = finding(parallel=p, debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
    api1.execute('findItemsAdvanced', {'keywords': 'python'})
    apis.append(api1)

    api4 = html(parallel=p)
    api4.execute('http://www.ebay.com/sch/i.html?_nkw=Shirt&_rss=1')
    apis.append(api4)

    api2 = finding(parallel=p, debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
    api2.execute('findItemsAdvanced', {'keywords': 'perl'})
    apis.append(api2)

    api3 = finding(parallel=p, debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
    api3.execute('findItemsAdvanced', {'keywords': 'php'})
    apis.append(api3)

    p.wait()

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

    for api in apis:

        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...\n" % dictstr[:50])
コード例 #2
0
def run(opts):

    try:
        p = Parallel()
        apis = []

        api1 = finding(parallel=p, debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
        api1.execute('findItemsAdvanced', {'keywords': 'python'})
        apis.append(api1)

        api4 = html(parallel=p)
        api4.execute('http://www.ebay.com/sch/i.html?_nkw=Shirt&_rss=1')
        apis.append(api4)

        api2 = finding(parallel=p, debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
        api2.execute('findItemsAdvanced', {'keywords': 'perl'})
        apis.append(api2)

        api3 = finding(parallel=p, debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
        api3.execute('findItemsAdvanced', {'keywords': 'php'})
        apis.append(api3)

        p.wait()

        if p.error():
            print p.error()

        for api in apis:
            dump(api)

    except ConnectionError as e:
        print e
コード例 #3
0
ファイル: finding.py プロジェクト: CoolCloud/ebaysdk-python
def run(opts):
    api = finding(siteid='EBAY-NLBE', debug=opts.debug, appid=opts.appid, config_file=opts.yaml,
                  warnings=True)

    api.execute('findItemsAdvanced', {
        'keywords': 'python',
        'itemFilter': [
            {'name': 'Condition',
             'value': 'Used'},
            {'name': 'LocatedIn',
             'value': 'GB'},
        ],
        'affiliate': {'trackingId': 1},
        'sortOrder': 'CountryDescending',
    })

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

    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[:250]
コード例 #4
0
ファイル: ebay.py プロジェクト: koprty/API-Project
def ebaysearch(searchwords,num=None):
    try:
        d=[]
        if num==None:
            num = 8
        api = finding(appid="Christin-2e88-4160-828c-885deb830846")             
        response = api.execute('findItemsAdvanced', {'keywords': searchwords})
        res = response.dict()
        #print res['itemSearchURL']
        res = res['searchResult']['item']
        #print res[0]['listingInfo']
        #print res
        for i, item in enumerate(res):
            if i > num:
                break
            name = item['title']
            price = float("{0:.2f}".format(float(item['sellingStatus']['currentPrice']['value'])))
            url = item['viewItemURL']
            img = item['galleryURL']
            listing = item['listingInfo']['listingType']
            if listing == "StoreInventory" or listing == "FixedPrice":
                listing = "Buy It Now"
            d.append( ( name, price, url, img, listing))
        sortedd=sorted(d, key=operator.itemgetter(1), reverse=False)
        for i, x in enumerate(sortedd):
            sortedd[i] = {'name':sortedd[i][0],'price':sortedd[i][1],'url':sortedd[i][2],'img_url':sortedd[i][3],'listing_type':sortedd[i][4]}
        return sortedd
    except ConnectionError as e:                                                
        print e                                                                
        return e.response.dict()
コード例 #5
0
def buildPreviewContext(request, max, config=False):
    contextdic = {}
    contextdic['APP_HOST'] = request.META['HTTP_HOST']
    contextdic.update(csrf(request))
    if ('keywords' in request.GET):
        finddic['keywords'] = request.GET['keywords']
        contextdic['KEYWORDS'] = request.GET['keywords']
    if not config:
        try:
            sellerid = request.GET['sellerid']
            finddic = {'itemFilter': [{'name': 'Seller', 'value': sellerid}]}
            contextdic['SELLER_ID'] = sellerid
            api = finding(siteid='EBAY-AU',
                          appid='zoyoea269-b772-4c8d-98bb-e8a23cefc0e')
            api.execute('findItemsAdvanced', finddic)
            dict = api.response_dict()
            result_count = int(str(dict.searchResult['count'].value))
            contextdic['ITEM_WIDTH'] = '200'
            if (result_count > 0):
                items = dict.searchResult['item']
                random.shuffle(items)
                contextdic['sellitems'] = items[0:12]
            else:
                contextdic['sellitems'] = []
        except ConnectionError as estr:
            contextdic['sellitems'] = []
        return contextdic
    else:
        return contextdic
コード例 #6
0
ファイル: main.py プロジェクト: zoyoe/ectool
def buildPreviewContext(request,max,config=False):
  contextdic = {}
  contextdic['APP_HOST'] = request.META['HTTP_HOST'] 
  contextdic.update(csrf(request))
  if ('keywords' in request.GET):
    finddic['keywords'] = request.GET['keywords']
    contextdic['KEYWORDS'] = request.GET['keywords']
  if not config:
    try:
      sellerid = request.GET['sellerid']
      finddic = {'itemFilter':[{'name':'Seller','value':sellerid}]}
      contextdic['SELLER_ID'] = sellerid
      api = finding(siteid='EBAY-AU',appid = 'zoyoea269-b772-4c8d-98bb-e8a23cefc0e');
      api.execute('findItemsAdvanced', finddic)
      dict = api.response_dict()
      result_count = int(str(dict.searchResult['count'].value))
      contextdic['ITEM_WIDTH'] = '200'
      if (result_count > 0):
        items = dict.searchResult['item']
        random.shuffle(items)
        contextdic['sellitems'] = items[0:12]
      else:
        contextdic['sellitems'] = []
    except ConnectionError as estr:
      contextdic['sellitems'] = []
    return contextdic
  else:
    return contextdic
コード例 #7
0
ファイル: market_val.py プロジェクト: unscsprt/DatPrice
def determine_below_mqt_val(search_in, cat):

    api = finding(appid=APPID)
    api.execute('findCompletedItems', {'keywords': search_in, \
                                       'categoryId': cat, \
                                       'Condition': '3000', \
                                       'soldItemsOnly': 'true',
                                       'sortOrder': 'EndTimeSoonest'})

    results = search_json.get_search_results_json(search_in, cat)
    total_values = 0
    avg = 0

    neg_run = 0

    ret = []

    for result in results:
        curr_mv = det_mv(result["title"]["value"])

        if (curr_mv < 0):
            neg_run += 1
            if (neg_run > 10):
                break
        else:
            ret.append({"MarketPrice": curr_mv,
            "ProductTitle" : result["title"]["value"],
            "ListPrice" : result["sellingStatus"]["convertedCurrentPrice"]["value"], 
            "URL" : result["viewItemURL"]["value"]
            })


    return {"Matches" : ret}
コード例 #8
0
def find(request):
    api = finding(siteid='EBAY-AU',
                  appid='zoyoea269-b772-4c8d-98bb-e8a23cefc0e')
    api.execute('findItemsAdvanced',
                {'itemFilter': [{
                    'name': 'Seller',
                    'value': 'p_ssg'
                }]})
    return HttpResponse(str(api.response_dict()))
コード例 #9
0
def run(opts):

    p = parallel()
    apis = []

    api1 = finding(parallel=p,
                   debug=opts.debug,
                   appid=opts.appid,
                   config_file=opts.yaml)
    api1.execute('findItemsAdvanced', {'keywords': 'python'})
    apis.append(api1)

    api4 = html(parallel=p)
    api4.execute('http://www.ebay.com/sch/i.html?_nkw=Shirt&_rss=1')
    apis.append(api4)

    api2 = finding(parallel=p,
                   debug=opts.debug,
                   appid=opts.appid,
                   config_file=opts.yaml)
    api2.execute('findItemsAdvanced', {'keywords': 'perl'})
    apis.append(api2)

    api3 = finding(parallel=p,
                   debug=opts.debug,
                   appid=opts.appid,
                   config_file=opts.yaml)
    api3.execute('findItemsAdvanced', {'keywords': 'php'})
    apis.append(api3)

    p.wait()

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

    for api in apis:

        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...\n" % dictstr[:50]
コード例 #10
0
def search_ebay(data):

    print data
    email = data['email']
    keywords = data['keywords']
    min_price = data['min_price']
    max_price = data['max_price']
    currency = data['currency']
    sort_order = data['sort_order']
    condition = data['condition']

    json_request = {
        'keywords':
        keywords,
        'itemFilter': [{
            'name': 'Condition',
            'value': condition
        }, {
            'name': 'MinPrice',
            'value': min_price,
            'paramName': 'Currency',
            'paramValue': currency
        }, {
            'name': 'MaxPrice',
            'value': max_price,
            'paramName': 'Currency',
            'paramValue': currency
        }],
        'sortOrder':
        sort_order
    }

    # called every minute
    timer = RepeatedTimer(30.0, search_ebay, data)

    api = finding(siteid='EBAY-US',
                  appid='juliengu-carte-PRD-fec73a437-365ab89a')

    api.execute('findItemsAdvanced', json_request)

    response = api.response.dict()

    print response
    print response['ack']

    ack = response['ack']

    if ack == 'Success':

        if response['searchResult']['_count'] != '0':

            timer.stop()
            element_a_envoye = response['searchResult']['item'][1]['title']
            item_url = response['searchResult']['item'][1]['viewItemURL']
            print response['searchResult']['item'][1]
            send_email.send_email(element_a_envoye, item_url, email)
コード例 #11
0
ファイル: listings_to_buy.py プロジェクト: unscsprt/DatPrice
def get_listings_to_buy_json(category):
	#initialize timer
	myObject = datetime.datetime.utcnow() + datetime.timedelta(seconds=1800)
	ebayObject = myObject.strftime("%Y-%m-%d" + "T" + "%H:%M:%S.000Z")
	api = finding(appid=APPID)
	api.execute('findItemsAdvanced', {'categoryId': category, \
										'EndTimeTo': ebayObject, \
										'SortOrderType': "PricePlusShippingLowest"})
	json_string = json.dumps(api.response_dict().get('searchResult').get('item'))
	return json_string
コード例 #12
0
ファイル: search_json.py プロジェクト: unscsprt/DatPrice
def get_search_results_json(keywords, categoryId):
    api = finding(appid=APPID)
    api.execute('findCompletedItems', {'keywords': keywords, \
                                       'categoryId': categoryId, \
                                       'Condition': '3000', \
                                       'soldItemsOnly': 'true', \
                                       'sortOrder': 'EndTimeSoonest'})
    
    json_out = api.response_dict().get('searchResult').get('item')
    print json_out
    return json_out
コード例 #13
0
ファイル: parallel.py プロジェクト: peterjliu/ebaysdk-python
def run(opts):

    try:
        p = Parallel()
        apis = []

        api1 = finding(parallel=p,
                       debug=opts.debug,
                       appid=opts.appid,
                       config_file=opts.yaml)
        api1.execute('findItemsAdvanced', {'keywords': 'python'})
        apis.append(api1)

        api4 = html(parallel=p)
        api4.execute('http://www.ebay.com/sch/i.html?_nkw=Shirt&_rss=1')
        apis.append(api4)

        api2 = finding(parallel=p,
                       debug=opts.debug,
                       appid=opts.appid,
                       config_file=opts.yaml)
        api2.execute('findItemsAdvanced', {'keywords': 'perl'})
        apis.append(api2)

        api3 = finding(parallel=p,
                       debug=opts.debug,
                       appid=opts.appid,
                       config_file=opts.yaml)
        api3.execute('findItemsAdvanced', {'keywords': 'php'})
        apis.append(api3)

        p.wait()

        if p.error():
            print p.error()

        for api in apis:
            dump(api)

    except ConnectionError as e:
        print e
コード例 #14
0
ファイル: finding.py プロジェクト: epinapala/ebaysdk-python
def run(opts):
    api = finding(debug=opts.debug, appid=opts.appid, config_file=opts.yaml) 
    api.execute('findItemsAdvanced', {'keywords': 'python'})

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

    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]
コード例 #15
0
ファイル: testFinding.py プロジェクト: atramos/ebay
def run2(opts):
    api = finding(debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
    api.execute('findItemsByProduct', '<productId type="ReferenceID">53039031</productId>')

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

    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[:500]
コード例 #16
0
def run2(opts):
    api = finding(debug=opts.debug, appid=opts.appid, config_file=opts.yaml)
    api.execute('findItemsByProduct',
                '<productId type="ReferenceID">53039031</productId>')

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

    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]
コード例 #17
0
def searchKeyword(keyword,
                  categoryID,
                  complete=False,
                  reggae=False,
                  maxresults=100,
                  pagenum=1):
    ## Create API object
    api = finding(siteid='EBAY-US',
                  debug=False,
                  appid=APPID,
                  config_file='ebay.yaml',
                  warnings=True)

    if complete: callFunction = 'findCompletedItems'
    else: callFunction = 'findItemsAdvanced'

    ## Define args for API call.
    args = {
        'categoryId': categoryID,
        'sortOrder': 'StartTimeNewest',
        'outputSelector': 'SellerInfo,AspectHistogram',
        'itemFilter': {
            'name': 'ListingType',
            'value': 'Auction'
        },
        'paginationInput': {
            'entriesPerPage': maxresults,
            'pageNumber': pagenum
        }
    }
    if reggae:
        args['aspectFilter'] = {
            'aspectName': 'Genre',
            'aspectValueName': 'Reggae, Ska & Dub'
        }
    if keyword != '': args['keywords'] = keyword

    ## Make API call
    api.execute(callFunction, args)

    ## Return XML String
    return api.response_content()
コード例 #18
0
ファイル: testFinding.py プロジェクト: atramos/ebay
def run(opts,findQuery):


    api = finding(siteid='EBAY-US', debug=opts.debug, appid=opts.appid, config_file=opts.yaml,
                  warnings=True)


    api.execute('findItemsAdvanced',findQuery)

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

    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()
    return api.response_dict()
コード例 #19
0
def run(opts, findQuery):

    api = finding(siteid='EBAY-US',
                  debug=opts.debug,
                  appid=opts.appid,
                  config_file=opts.yaml,
                  warnings=True)

    api.execute('findItemsAdvanced', findQuery)

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

    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()
    return api.response_dict()
コード例 #20
0
def run(opts):
    api = finding(siteid='EBAY-NLBE',
                  debug=opts.debug,
                  appid=opts.appid,
                  config_file=opts.yaml,
                  warnings=True)

    api.execute(
        'findItemsAdvanced', {
            'keywords':
            'python',
            'itemFilter': [
                {
                    'name': 'Condition',
                    'value': 'Used'
                },
                {
                    'name': 'LocatedIn',
                    'value': 'GB'
                },
            ],
            'affiliate': {
                'trackingId': 1
            },
            'sortOrder':
            'CountryDescending',
        })

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

    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[:250]
コード例 #21
0
ファイル: ebay.py プロジェクト: patthebug/EbayAPI
def ReadData():
    with open('data', 'rb') as csvfile:
         booksDict = {}
         csvReader = csv.reader(csvfile, delimiter=',', quotechar='|')
         next(csvReader, None)
         counter = 0
         for row in csvReader:
             title = row[2].replace('"', '')
             api = finding(appid='Universi-ab00-4257-afba-7d353c3c7d4d')
             api.execute('findItemsAdvanced', {'keywords': title})
             searchResults = json.loads(api.response_json())
             if('errorMessage' in searchResults):
                 if(str(searchResults['errorMessage']['error']['errorId']['value']) == '6'):
                    break

             searchResult = searchResults['searchResult']
             if(searchResult.has_key('item')):
                 if(len(searchResult['item']) > 0):
                     for count in range(int(searchResults['searchResult']['count']['value'])):
                         if(int(searchResult['count']['value']) == 1):
                             if('condition' in searchResult['item']):
                                 if(searchResult['item']['condition']['conditionDisplayName']['value'] == 'Brand New'):
                                    counter += 1
                                    itemURL = searchResult['item']['viewItemURL']['value']
                                    print str(counter) + itemURL
                                    PopulateBooksDict(itemURL, booksDict, row, searchResult, count, 1)
                         elif('condition' in searchResult['item'][count]):
                             if(searchResult['item'][count]['condition']['conditionDisplayName']['value'] == 'Brand New'):
                                 counter += 1
                                 itemURL = searchResult['item'][count]['viewItemURL']['value']
                                 print str(counter) + itemURL
                                 if(counter == 98):
                                     x=0
                                 PopulateBooksDict(itemURL, booksDict, row, searchResult, count, 0)
                         else:
                             continue

    WriteOutput(booksDict)
コード例 #22
0
def search_for_articles(year, company, see, player, db_name):
    api = finding(appid=appid)

    api.execute ('findItemsAdvanced', {
        'keywords': f'{year}, {company}, {see}, {player}',
    }
    )

    dictstr = api.response.dict()
    list_data = []
    for list_dict in dictstr["searchResult"]["item"]:
        data_price = list_dict["sellingStatus"]["currentPrice"]
        list_dict.setdefault('coin', data_price['_currencyId'])
        list_dict.setdefault('price', data_price['value'])
        list_dict.setdefault('startTime', list_dict['listingInfo']['startTime'])
        list_dict.setdefault('endTime', list_dict['listingInfo']['endTime'])
        list_dict.pop('sellingStatus')
        list_dict.pop('listingInfo')
        list_data.append(list_dict)
    print("1")
    df = pd.DataFrame(list_data).astype(str)
    print("2")
    df.to_sql(name=db_name, con=mydb, index=False, if_exists='replace')
    print("3")
コード例 #23
0
def searchKeyword(keyword,categoryID,complete=False,reggae=False,maxresults=100,pagenum=1):
    ## Create API object
    api = finding(siteid='EBAY-US', debug=False, 
                  appid=APPID, 
                  config_file='ebay.yaml',
                  warnings=True)
    
    if complete: callFunction = 'findCompletedItems'
    else:  callFunction = 'findItemsAdvanced'
    
    ## Define args for API call.
    args = {'categoryId' : categoryID,  
                'sortOrder' : 'StartTimeNewest',
                'outputSelector': 'SellerInfo,AspectHistogram',    
                'itemFilter': {'name':'ListingType','value':'Auction'},
                'paginationInput': { 'entriesPerPage' : maxresults, 'pageNumber' : pagenum}}
    if reggae: args['aspectFilter'] = { 'aspectName' : 'Genre', 'aspectValueName':'Reggae, Ska & Dub'}
    if keyword!='': args['keywords'] = keyword

    ## Make API call          
    api.execute(callFunction, args)

    ## Return XML String
    return api.response_content()
コード例 #24
0
ファイル: api.py プロジェクト: mnjstwins/ebay-search-api
	def __init__(self, **kwargs):
		"""
		Initialization method.

		Parameters
		----------
		sandbox : boolean
		see Ebay class

		Returns
		-------
		New instance of :class:`Finding` : Finding

		Examples
		--------
		>>> finding = Finding(sandbox=True)
		>>> finding  #doctest: +ELLIPSIS
		<app.api.Finding object at 0x...>
		>>> finding.kwargs['domain']
		'svcs.sandbox.ebay.com'
		>>> finding = Finding(sandbox=False)
		>>> finding.kwargs['domain']
		'svcs.ebay.com'
		"""
		super(Finding, self).__init__(**kwargs)
		domain = 'svcs.sandbox.ebay.com' if self.sandbox else 'svcs.ebay.com'

		new = {
			'siteid': self.global_ids[self.kwargs['country']]['countryabbr'],
			'domain': domain,
			'version': '1.0.0',
			'compatibility': '1.0.0',
		}

		self.kwargs.update(new)
		self.api = finding(**self.kwargs)
コード例 #25
0
ファイル: search.py プロジェクト: jph98/ebayclisearch
if keywords is None:
	exit("Please specify some keywords to search for")

sort_order_type = options.sortorder
if options.sortorder == "price":
	sort_order_type = "PricePlusShippingLowest"
elif options.sortorder == "end":
	sort_order_type = "EndTimeSoonest"
elif options.sortorder == "start":
	sort_order_type = "StartTimeSoonest"

print "\n" + "#" * 100
print "Please wait, searching Ebay for %s" % keywords + " with options " + sort_order_type

# http://developer.ebay.com/devzone/finding/callref/findItemsAdvanced.html
f = finding()
f.execute('findItemsAdvanced', {'keywords': keywords, 'sortOrder': sort_order_type} )

response_dom 	= f.response_dom()
response_dict 	= f.response_dict()
response  		= f.response_obj()


# process the response via DOM
items = response_dom.getElementsByTagName('item')

found_items = []
if len(items) > 0:
	print "#" * 100
	print "Item search URL " + response.itemSearchURL
	for item in items:
コード例 #26
0
ファイル: main.py プロジェクト: silverdev/ebayLoc
 def __init__(self) :
     self.api = finding(appid="corbinso-0418-4f1f-9512-0758cbf2744c")
     self.zip_counter=0 #counts the number of buyers from this zipcode
     self.avg_price=0
     self.zip_price=0
     self.num_items =0 #the number of results
コード例 #27
0
ファイル: ebay_find.py プロジェクト: warnj/Python-Misc
import ebaysdk
from ebaysdk import finding

api = finding(siteid='EBAY-GB', appid='<REPLACE WITH YOUR OWN APPID>')

api.execute('findItemsAdvanced', {
    'keywords': 'laptop',
    'categoryId': ['177', '111422'],
    'itemFilter': [
        {'name': 'Condition', 'value': 'Used'},
        {'name': 'MinPrice', 'value': '200', 'paramName': 'Currency', 'paramValue': 'GBP'},
        {'name': 'MaxPrice', 'value': '400', 'paramName': 'Currency', 'paramValue': 'GBP'}
    ],
    'paginationInput': {
        'entriesPerPage': '25',
        'pageNumber': '1'
    },
    'sortOrder': 'CurrentPriceHighest'
})

dictstr = api.response_dict()

for item in dictstr['searchResult']['item']:
    print("ItemID: %s" % item['itemId'].value)
    print("Title: %s" % item['title'].value)
    print("CategoryID: %s" % item['primaryCategory']['categoryId'].value)
コード例 #28
0
	#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:	
		for item in product_items.ItemArray.Item:
			pprint.pprint(item)
			if not isinstance(item, basestring):
コード例 #29
0
ファイル: Globals.py プロジェクト: rainz/EbayTools
from codecs import getwriter
from sys import argv, stdout

from ebaysdk import finding
from ebaysdk import shopping

import json
import os.path

home_dir = os.path.expanduser("~")

with open(os.path.join(home_dir, 'ApiKeys/EbayKey.json')) as key_file:    
    keys = json.load(key_file)

MEM_CATEGORY = 170083
CPU_CATEGORY = 164
COMPUTER_PARTS_CATEGORY = 175673

UTF8Writer = getwriter('utf8')
stdout = UTF8Writer(stdout)

myAppId = keys['AppId']
apiFinding = finding(appid=myAppId)
apiShopping = shopping(appid=myAppId)
コード例 #30
0
ファイル: ebay.py プロジェクト: KSU-PennApps-F13/PinchBackend
 def __init__(self, appid):
   ShoppingAPI.__init__(self)
   self._api = ebay.finding(appid=appid)
コード例 #31
0
import ebaysdk
from ebaysdk import finding

api = finding(siteid='EBAY-GB', appid='<REPLACE WITH YOUR OWN APPID>')

api.execute(
    'findItemsAdvanced', {
        'keywords':
        'laptop',
        'categoryId': ['177', '111422'],
        'itemFilter': [{
            'name': 'Condition',
            'value': 'Used'
        }, {
            'name': 'MinPrice',
            'value': '200',
            'paramName': 'Currency',
            'paramValue': 'GBP'
        }, {
            'name': 'MaxPrice',
            'value': '400',
            'paramName': 'Currency',
            'paramValue': 'GBP'
        }],
        'paginationInput': {
            'entriesPerPage': '25',
            'pageNumber': '1'
        },
        'sortOrder':
        'CurrentPriceHighest'
    })
コード例 #32
0
ファイル: ebay.py プロジェクト: KSU-PennApps-F13/PinchBackend
 def __init__(self, appid):
     ShoppingAPI.__init__(self)
     self._api = ebay.finding(appid=appid)
コード例 #33
0
from ebaysdk import finding, shopping
import numpy, pprint
from datetime import datetime, timedelta
import ConfigParser
import os

DIR = os.path.dirname(os.path.realpath(__file__))

config = ConfigParser.RawConfigParser()
config.read(os.path.join(DIR,'config.cfg'))
unwantedConditions = ['For parts or not working']

app = Flask(__name__)
app.debug = True
appid = config.get('Ebay','appid')
api = finding(appid=appid)
api2 = shopping(appid=appid)

@app.route('/')
def index():
	return render_template('index.html')

@app.route('/findCategory', methods = ['POST'])
@app.route('/findCategory/<searchTerm>')
@app.route('/findCategory/<searchTerm>/<categoryId>')
def findCategory(searchTerm=None, categoryId=None):
	if searchTerm is None:
		searchTerm = request.form['searchTerm']
	params = {
		'itemFilter': [
	        {'name': 'Condition', 'value': 'Used'},
コード例 #34
0
ファイル: main.py プロジェクト: zoyoe/ectool
def find(request):
  api = finding(siteid='EBAY-AU',appid = 'zoyoea269-b772-4c8d-98bb-e8a23cefc0e');
  api.execute('findItemsAdvanced',
    {'itemFilter':[{'name':'Seller','value':'p_ssg'}]
    })
  return HttpResponse(str(api.response_dict()))