completed conditional to check for itemId existence in csv data and 20-itemId string list generator
This commit is contained in:
parent
873050f898
commit
9d02381140
@ -14,9 +14,9 @@ class FindingApi:
|
||||
]
|
||||
pageNumber = list(range(1, 63))
|
||||
|
||||
# departments = ["3034","93427"]
|
||||
# departments = ["3034","93427"] (womens and mens)
|
||||
|
||||
def get_ids(self):
|
||||
def get_ids_from_cats():
|
||||
itemid_results_list = []
|
||||
for category_id in cat_list:
|
||||
for i in FindingApi.pageNumber:
|
||||
@ -29,20 +29,17 @@ class FindingApi:
|
||||
"paginationInput.entriesPerPage":"100",
|
||||
"paginationInput.PageNumber":FindingApi.pageNumber[i]
|
||||
}
|
||||
# extract item id here for piping into shopping_test.py
|
||||
|
||||
response = requests.get("https://svcs.ebay.com/services/search/FindingService/v1", params=params)
|
||||
data = response.json()
|
||||
for item in data['findItemsByCategoryResponse'][0]['searchResult'[0]['item']:
|
||||
itemid_results_list.append(item['itemId']) # above this line you will have to check whether the id exists in the pandas dataframe before you go on to create your list for the shopping
|
||||
#api: check df --> if does not exist, append itemId to itemid_results_list --> with curated list, make a list of 20-itemId lists.
|
||||
item_id_results = list(map(str, itemid_results_list))
|
||||
item_id_results = ','.join(item_id_results) # you will have to split this into 20 item lists strings to feed into ItemID param. Consider making a list of str lists.
|
||||
item_id_results = ','.join(item_id_results_list) # you will have to split this into 20 item lists strings to feed into ItemID param. Consider making a list of str lists.
|
||||
return item_id_results
|
||||
|
||||
class ShoppingApi:
|
||||
|
||||
def get_item(self):
|
||||
def get_item_from_findItemsByCategory():
|
||||
|
||||
params = {
|
||||
"callname":"GetMultipleItems",
|
||||
|
Loading…
Reference in New Issue
Block a user