From 1564ebbb68568220ac8721fe591d7d608c130380 Mon Sep 17 00:00:00 2001 From: Joan Cano Date: Thu, 2 Mar 2023 12:58:51 +0100 Subject: [PATCH] . --- wallamanta/worker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wallamanta/worker.py b/wallamanta/worker.py index da26da6..c2e4f3b 100644 --- a/wallamanta/worker.py +++ b/wallamanta/worker.py @@ -77,11 +77,11 @@ class Worker: try: if not self.has_excluded_words(article['title'].lower(), article['description'].lower(), product['exclude']) and not self.is_title_key_word_excluded(article['title'].lower(), product['title_keyword_exclude']): 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(article['price'])} {helpers.telegram_escape_characters(article['currency'])}\n[Ir al anuncio](https://es.wallapop.com/item/{helpers.telegram_escape_characters(article['web_slug'])})" + 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(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(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(article['price'])} {helpers.telegram_escape_characters(article['currency'])}\n[Ir al anuncio](https://es.wallapop.com/item/{helpers.telegram_escape_characters(article['web_slug'])})" + 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(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(requests.get(url).json()) time.sleep(1) # Avoid Telegram flood restriction