diff --git a/README.html b/README.html index 7bb6fe2..bc0b10e 100644 --- a/README.html +++ b/README.html @@ -55,30 +55,43 @@
-Dieses Python-Skript sucht nach versteckten "Eiern" auf der Website www.netcup.de und listet die Sonderangebote in Textdateien auf.
++ Besuchen Sie napo-ii.de für den Live-Tracker mit den aktuellen Eggs vom Netcup-Event. +
+git clone https://github.com/NSG22/netcup_egg_tracker
+ git clone https://github.com/NapoII/netcup_egg_tracker
pip install -r requirements.txt
💭 How it works
@@ -96,10 +109,17 @@ 💭 How it works
Stellen Sie sicher, dass das Skript über die erforderlichen Berechtigungen zum Schreiben von Dateien im aktuellen Verzeichnis verfügt.
+ ☕ Buy me a coffee
+ Feel free to show your appreciation by treating me to a virtual coffee. Your support means a lot and keeps the creative coding vibes going! 🚀
+
+
📚 LICENSE
GNU GENERAL PUBLIC LICENSE Version 3
netcup_egg_tracker was created on 31.March.2024 by NapoII
+
+
+
+ +
diff --git a/README_img/Readme_top.png b/README_img/Readme_top.png index 4c81ab2..1291431 100644 Binary files a/README_img/Readme_top.png and b/README_img/Readme_top.png differ diff --git a/netcup_egg_tracker/netcup_egg_tracker.py b/netcup_egg_tracker/netcup_egg_tracker.py index e02472f..f5a6cde 100644 --- a/netcup_egg_tracker/netcup_egg_tracker.py +++ b/netcup_egg_tracker/netcup_egg_tracker.py @@ -35,12 +35,14 @@ def get_price_formatted(price): def main(): current_year = datetime.now().year # Aktuelles Jahr abrufen folder_path = f"eggs_{current_year}" # Ordnername mit aktuellem Jahr erstellen + if not os.path.exists(folder_path): os.makedirs(folder_path) while True: for r in refs: + try: resp = requests.post("https://www.netcup.de/api/eggs", data={"requrl": r}) response_text = json.loads(resp.text)["eggs"] @@ -50,7 +52,7 @@ def main(): print(f"Kein Angebot gefunden für {r}") print(f"{'-' * 10}") continue - + egg = response_text[0] if egg['title'][-1] == " ": egg['title'] = egg['title'][:-1] @@ -63,7 +65,7 @@ def main(): full_folder_path = os.path.join(folder_path, sub_folder) if not os.path.exists(full_folder_path): os.makedirs(full_folder_path) - + path = os.path.join(full_folder_path, file_name) egg['original_url'] = f"https://www.netcup.de/bestellen/produkt.php?produkt={egg['product_id']}&ref=230003&hiddenkey={egg['product_key']}" @@ -71,10 +73,8 @@ def main(): egg['found_unix_time'] = int(time.time()) # Hinzufügen der Unix-Zeit with open(path, "w") as file: json.dump(egg, file, indent=4) - - if os.path.exists(path):# nicht neu printen, falls schon vorhanden - continue - + + print(f"{'-' * 10}") print(f"{egg['title']}") print(f"{price}") @@ -82,11 +82,12 @@ def main(): print(f"{egg['found_url']}") # Ausgabe der gefundenen URL print(f"Found Unix Time: {egg['found_unix_time']}") # Ausgabe der gefundenen Unix-Zeit print(f"{'-' * 10}") + except Exception as e: - print(e) + pass print(f"\n\n Time Sleep - {2*60}") time.sleep(2 * 60) if __name__ == "__main__": - main() + main() \ No newline at end of file