From 82161973a9c46aebc44f41552f7377f721a38314 Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 18 Jun 2024 16:38:29 +0200 Subject: [PATCH 1/4] Added weather carad --- V6.py | 21 ++------------------- version | 2 +- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/V6.py b/V6.py index 8213de2..e134fc4 100755 --- a/V6.py +++ b/V6.py @@ -220,22 +220,6 @@ def all_cards(): custom_sleep(1.5) return True - def check_streak_protection() -> bool: - """ - Ne perdez plus jamais votre série ! - """ - try: - streak_protection_close = driver.find_element(By.ID, "streak-protection-popup-close-cross") - streak_protection_activate = driver.find_elements(By.CLASS_NAME, "earningPagePopUpPopUpSelectButton") - streak_protection_activate[0].click() - info("Popup 'Streak Protection' reçue") - custom_sleep(1.5) - - return True - except (exceptions.NoSuchElementException, exceptions.ElementNotInteractableException, IndexError): - # les éléments sont présents dans le DOM même quand la popup n'est pas visible apparemment - return False - driver.get("https://rewards.bing.com") wait_until_visible(By.CLASS_NAME, "c-card-content", 10, driver) @@ -290,7 +274,6 @@ def all_cards(): custom_sleep(1.5) check_welcome_tour() - check_streak_protection() driver.execute_script("arguments[0].scrollIntoView();", card_list[i]) custom_sleep(1.5) card_list[i].click() @@ -308,7 +291,6 @@ def all_cards(): continue check_welcome_tour() - check_streak_protection() driver.execute_script("arguments[0].scrollIntoView();", card_list[i]) card_list[i].click() @@ -420,6 +402,8 @@ def explore_on_bing(activity: str, config: Config): ] chosen = random.sample(currencies, k=2) search_bing(f"convertir {random.randint(2, 120)} {chosen[0]} en {chosen[1]}") + elif "weather" in activity: + search_bing(f"météo {['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]}") else: log_error(f"Explore on bing: {activity} not found.") @@ -897,7 +881,6 @@ def default_start(): try: config.WebDriver.set_pc_driver(create_driver()) except: - info("Could not configure driver. Trying to update it.") subprocess.Popen(["python3", "/app/MsRewards-Reborn/modules/Tools/update_chrome.py"]) config.WebDriver.set_pc_driver(create_driver()) config.WebDriver.switch_to_driver("PC") diff --git a/version b/version index 790346f..7ccc665 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.8.56 +v6.8.57 From f9a21f5b9803bcdca80c398a07dd90bade44d0c2 Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 18 Jun 2024 16:54:37 +0200 Subject: [PATCH 2/4] Added package tracking card --- V6.py | 3 +++ version | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/V6.py b/V6.py index e134fc4..f58b484 100755 --- a/V6.py +++ b/V6.py @@ -404,6 +404,9 @@ def explore_on_bing(activity: str, config: Config): search_bing(f"convertir {random.randint(2, 120)} {chosen[0]} en {chosen[1]}") elif "weather" in activity: search_bing(f"météo {['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]}") + elif "packagetracking" in activity: + driver.get("https://www.bing.com/?setmkt=en-US&setlang=en-US") + search_bing(f"{['fedex', 'UPS', '']} package tracking") else: log_error(f"Explore on bing: {activity} not found.") diff --git a/version b/version index 7ccc665..0b8be34 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.8.57 +v6.8.58 From a197d44768bd5268355e8030f33315f996e8c79e Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 18 Jun 2024 20:37:14 +0200 Subject: [PATCH 3/4] Added package tracking card --- V6.py | 5 +++++ version | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/V6.py b/V6.py index 8213de2..78b0109 100755 --- a/V6.py +++ b/V6.py @@ -420,6 +420,11 @@ def explore_on_bing(activity: str, config: Config): ] chosen = random.sample(currencies, k=2) search_bing(f"convertir {random.randint(2, 120)} {chosen[0]} en {chosen[1]}") + elif "weather" in activity: + search_bing(f"météo {['Paris', 'Nice', 'Marseille', 'Bordeaux', 'Lyon'][randint(0, 4)]}") + elif "packagetracking" in activity: + driver.get("https://www.bing.com/?setmkt=en-US&setlang=en-US") + search_bing(f"{['fedex', 'UPS', '']} package tracking") else: log_error(f"Explore on bing: {activity} not found.") diff --git a/version b/version index 790346f..7ccc665 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.8.56 +v6.8.57 From 41312b53b93a24d91e7f3a629809e45eac08f20f Mon Sep 17 00:00:00 2001 From: piair Date: Tue, 18 Jun 2024 20:50:55 +0200 Subject: [PATCH 4/4] =?UTF-8?q?c'est=20bon=20l=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V6.py | 19 +++++++++++++++++++ version | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/V6.py b/V6.py index f58b484..78b0109 100755 --- a/V6.py +++ b/V6.py @@ -220,6 +220,22 @@ def all_cards(): custom_sleep(1.5) return True + def check_streak_protection() -> bool: + """ + Ne perdez plus jamais votre série ! + """ + try: + streak_protection_close = driver.find_element(By.ID, "streak-protection-popup-close-cross") + streak_protection_activate = driver.find_elements(By.CLASS_NAME, "earningPagePopUpPopUpSelectButton") + streak_protection_activate[0].click() + info("Popup 'Streak Protection' reçue") + custom_sleep(1.5) + + return True + except (exceptions.NoSuchElementException, exceptions.ElementNotInteractableException, IndexError): + # les éléments sont présents dans le DOM même quand la popup n'est pas visible apparemment + return False + driver.get("https://rewards.bing.com") wait_until_visible(By.CLASS_NAME, "c-card-content", 10, driver) @@ -274,6 +290,7 @@ def all_cards(): custom_sleep(1.5) check_welcome_tour() + check_streak_protection() driver.execute_script("arguments[0].scrollIntoView();", card_list[i]) custom_sleep(1.5) card_list[i].click() @@ -291,6 +308,7 @@ def all_cards(): continue check_welcome_tour() + check_streak_protection() driver.execute_script("arguments[0].scrollIntoView();", card_list[i]) card_list[i].click() @@ -884,6 +902,7 @@ def default_start(): try: config.WebDriver.set_pc_driver(create_driver()) except: + info("Could not configure driver. Trying to update it.") subprocess.Popen(["python3", "/app/MsRewards-Reborn/modules/Tools/update_chrome.py"]) config.WebDriver.set_pc_driver(create_driver()) config.WebDriver.switch_to_driver("PC") diff --git a/version b/version index fcb8bd0..9ba6beb 100644 --- a/version +++ b/version @@ -1 +1 @@ -v6.8.60 +v6.8.61