From fc793f4456f0ec56a46f258508a4afe69b235163 Mon Sep 17 00:00:00 2001 From: scott Date: Tue, 4 Jan 2022 20:50:42 -0700 Subject: [PATCH] get_item_fromfindItemsByCateogry fix. Invalid token errors persist --- ebay_api.py | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/ebay_api.py b/ebay_api.py index 8b57d3f..4bea7fa 100644 --- a/ebay_api.py +++ b/ebay_api.py @@ -64,9 +64,9 @@ class FindingApi: "itemFilter.name":"HideDuplicateItems", "itemFilter.value":"true", "sortOrder":"StartTimeNewest", - "itemFilter(1).name":"TopRatedSellerOnly", - "itemFilter(1).value":"true", } +# "itemFilter(1).name":"TopRatedSellerOnly", # TODO fix here +# "itemFilter(1).value":"true" try: response = requests.get("https://svcs.ebay.com/services/search/FindingService/v1", @@ -142,15 +142,6 @@ class ShoppingApi: for department in parent_cats: -# params = { -# "callname":"GetCategoryInfo", -# "X-EBAY-API-IAF-TOKEN":cfg.sec['X-EBAY-API-IAF-TOKEN'], -# "version":"671", -# "responseencoding":"JSON", -# "CategoryID":department, -# "IncludeSelector":"ChildCategories", -# } - headers = { "X-EBAY-API-IAF-TOKEN":cfg.sec['X-EBAY-API-IAF-TOKEN'], # TODO implement auto oauth token renewal "version":"671", @@ -174,8 +165,6 @@ class ShoppingApi: with open('cat_list.txt', 'w') as f: json.dump(cat_list, f) - # leaf_list = [node['LeafCategory'] for node in response] - def get_item_from_findItemsByCategory(self, twenty_id): ''' @@ -218,11 +207,11 @@ class ShoppingApi: data = [] try: - with open('item_id_results.txt') as f: + with open('item_id_results.txt') as f: # TODO fix here item_id_results = json.load(f) except (FileNotFoundError, ValueError): - item_id_results = scrape_ids.main() + item_id_results = scrape_ids.main()# TODO fix here with concurrent.futures.ThreadPoolExecutor() as executor: for future in executor.map(self.get_item_from_findItemsByCategory, item_id_results):