From 8ffc1032afe817e637c9bbffb8d1e6af2a70f98c Mon Sep 17 00:00:00 2001 From: Joan Cano Date: Thu, 2 Mar 2023 19:13:45 +0100 Subject: [PATCH] =?UTF-8?q?A=C3=B1adido=20m=C3=A1s=20debugging,=20algunos?= =?UTF-8?q?=20productos=20no=20muestra=20el=20enlace=20o=20el=20formato=20?= =?UTF-8?q?correcto=20en=20el=20mensaje?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wallamanta/worker.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wallamanta/worker.py b/wallamanta/worker.py index 6af7653..aa4d50f 100644 --- a/wallamanta/worker.py +++ b/wallamanta/worker.py @@ -78,10 +78,12 @@ class Worker: try: text = f"*Artículo*: {helpers.telegram_escape_characters(article['title'])}\n*Descripción*: {helpers.telegram_escape_characters(article['description'])}\n*Precio*: {helpers.telegram_escape_characters(str(article['price']))} {helpers.telegram_escape_characters(article['currency'])}\n[Ir al anuncio](https://es\.wallapop\.com/item/{helpers.telegram_escape_characters(article['web_slug'])})" url = f"https://api.telegram.org/bot{TELEGRAM_TOKEN}/sendMessage?chat_id={TELEGRAM_CHANNEL_ID}&text={text}&parse_mode=MarkdownV2" + logging.info(text) logging.info(requests.get(url).json()) except: text = f"*Artículo*: {helpers.telegram_escape_characters(article['title'])}\n*Descripción*: {helpers.telegram_escape_characters(article['description'])}\n*Precio*: {helpers.telegram_escape_characters(str(article['price']))} {helpers.telegram_escape_characters(article['currency'])}\n[Ir al anuncio](https://es\.wallapop\.com/item/{helpers.telegram_escape_characters(article['web_slug'])})" url = f"https://api.telegram.org/bot{TELEGRAM_TOKEN}/sendMessage?chat_id={TELEGRAM_CHANNEL_ID}&text={text}&parse_mode=MarkdownV2" + logging.info(text) logging.info(requests.get(url).json()) time.sleep(1) # Avoid Telegram flood restriction list.insert(0, article['id'])