From 031bb043ffbc12f160cfb6e5fa6fd85533165799 Mon Sep 17 00:00:00 2001 From: Daniel <54587088+Kifixo@users.noreply.github.com> Date: Mon, 7 Mar 2022 14:17:01 +0100 Subject: [PATCH] Enable distance support --- worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker.py b/worker.py index a4959ae..508695b 100644 --- a/worker.py +++ b/worker.py @@ -15,7 +15,7 @@ SLEEP_TIME=30 class Worker: - def request(self, product_name, n_articles, latitude='40.4165', longitude='-3.70256', condition='all', min_price=0, max_price=10000000): + def request(self, product_name, n_articles, latitude='40.4165', longitude='-3.70256', distance='0', condition='all', min_price=0, max_price=10000000): url = (f"http://api.wallapop.com/api/v3/general/search?keywords={product_name}" f"&order_by=newest&latitude={latitude}" f"&longitude={longitude}" @@ -55,7 +55,7 @@ class Worker: while True: start_time = time.time() - articles = self.request(args['product_name'], 0, args['latitude'], args['longitude'], args['condition'], args['min_price'], args['max_price']) + articles = self.request(args['product_name'], 0, args['latitude'], args['longitude'], args['distance'], args['condition'], args['min_price'], args['max_price']) for article in articles: if not article['id'] in list: try: