Skip to content

Commit

Permalink
merge the fork from NSG22 to main
Browse files Browse the repository at this point in the history
  • Loading branch information
NapoII committed Apr 3, 2024
1 parent 88528be commit 1735176
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 22 deletions.
34 changes: 27 additions & 7 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,30 +55,43 @@
</head>

<body>
<div class="container">
<a href="https://github.com/NSG22/netcup_egg_tracker/blob/main/LICENSE"><img src="https://img.shields.io/github/license/NSG22/netcup_egg_tracker" alt="github/license"></a>
<a href="https://img.shields.io/gitea/last-commit/nsg22/netcup_egg_tracker/main?style=plastic"><img src="https://img.shields.io/gitea/last-commit/nsg22/netcup_egg_tracker/main" alt="github/last-commit"></a>
<a href="https://img.shields.io/github/issues-raw/NSG22/netcup_egg_tracker?style=plastic"><img src="https://img.shields.io/github/issues-raw/NSG22/netcup_egg_tracker" alt="github/issues_open"></a>
<a href="https://github.com/NSG22/netcup_egg_tracker/stargazers"><img src="https://img.shields.io/github/stars/NSG22/netcup_egg_tracker?style=social" alt="github/stars"></a>
<div class="container">
<a href="https://github.com/NapoII/netcup_egg_tracker">
<img src="https://raw.githubusercontent.com/NapoII/netcup_egg_tracker/main/README_img/Readme_top.png" alt="GitHub/NapoII/netcup_egg_tracker" style="max-width: 100%; max-height: 200px;">
</a>
<a href="https://github.com/NapoII/netcup_egg_tracker/archive/refs/heads/main.zip"><img src="https://img.shields.io/github/downloads/NapoII/netcup_egg_tracker/total" alt="downloads/total"></a>
<a href="https://github.com/NapoII/netcup_egg_tracker/archive/refs/heads/main.zip"><img src="https://img.shields.io/github/repo-size/NapoII/netcup_egg_tracker" alt="github/repo-size"></a>
<a href="https://github.com/NapoII/netcup_egg_tracker/blob/main/LICENSE"><img src="https://img.shields.io/github/license/NapoII/netcup_egg_tracker" alt="github/license"></a>
<a href="https://img.shields.io/github/issues/NapoII/netcup_egg_tracker?style=plastic"><img src="https://img.shields.io/github/last-commit/NapoII/netcup_egg_tracker/total" alt="github/last-commit"></a>
<a href="https://img.shields.io/github/issues/NapoII/netcup_egg_tracker?style=plastic"><img src="https://img.shields.io/github/issues-raw/NapoII/netcup_egg_tracker" alt="github/issues_open"></a>
<a href="https://github.com/NapoII/netcup_egg_tracker/stargazers"><img src="https://img.shields.io/github/stars/NapoII/netcup_egg_tracker?style=social" alt="github/stars"></a>
<a href="https://discord.gg/knTKtKVfnr"><img src="https://img.shields.io/discord/190307701169979393" alt="discord"></a>

<h1>netcup_egg_tracker</h1>
<p>Dieses Python-Skript sucht nach versteckten "Eiern" auf der Website www.netcup.de und listet die Sonderangebote in Textdateien auf.</p>

<div>
<p>
Besuchen Sie <a href="http://napo-ii.de/">napo-ii.de</a> für den Live-Tracker mit den aktuellen Eggs vom Netcup-Event.
</p>
</div>


<h2>📝 Table of Contents</h2>
<ul>
<li><a href="#demo">Demo / Working</a></li>
<li><a href="#usage">Install</a></li>
<li><a href="#Use">How it works</a></li>
<li><a href="#coffee">Buy me a coffee</a></li>
<li><a href="#LICENSE">LICENSE</a></li>
</ul>

<h2>🎥 Demo / Working <a name="demo"></a></h2>
<img src="https://raw.githubusercontent.com/NSG22/netcup_egg_tracker/main/README_img/demo.png" alt="Img von folder mit angeboten">
<img src="https://raw.githubusercontent.com/NapoII/netcup_egg_tracker/main/README_img/demo.png" alt="Img von folder mit angeboten">


<h2>💻 Install <a name="usage"></a></h2>
<pre><code>git clone https://github.com/NSG22/netcup_egg_tracker
<pre><code>git clone https://github.com/NapoII/netcup_egg_tracker
pip install -r requirements.txt</code></pre>

<h2>💭 How it works <a name="Use"></a></h2>
Expand All @@ -96,10 +109,17 @@ <h2>💭 How it works <a name="Use"></a></h2>
<li>Stellen Sie sicher, dass das Skript über die erforderlichen Berechtigungen zum Schreiben von Dateien im aktuellen Verzeichnis verfügt.</li>
</ul>

<h2>☕ Buy me a coffee <a name="coffee"></a></h2>
<p>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! 🚀</p>
<a href='https://ko-fi.com/M4M0TS4ZM' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

<h2>📚 LICENSE <a name="LICENSE"></a></h2>
<p><a href="LICENSE">GNU GENERAL PUBLIC LICENSE Version 3</a></p>
<p><i>netcup_egg_tracker</i> was created on 31.March.2024 by <a href="https://github.com/NapoII">NapoII</a></p>

<p align="center">
<img src="https://raw.githubusercontent.com/NapoII/NapoII/233630a814f7979f575c7f764dbf1f4804b05332/Bottom.svg" alt="Github Stats" />
</p>
</div>
</body>

Expand Down
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
[![github/NapoII/netcup_egg_tracker](https://raw.githubusercontent.com/NapoII/netcup_egg_tracker/main/README_img/Readme_top.png)](https://github.com/NapoII/netcup_egg_tracker)
[![downloads/total](https://img.shields.io/github/downloads/NapoII/netcup_egg_tracker/total)](https://github.com/NapoII/netcup_egg_tracker/archive/refs/heads/main.zip) [![github/repo-size](https://img.shields.io/github/repo-size/NapoII/netcup_egg_tracker)](https://github.com/NapoII/netcup_egg_tracker/archive/refs/heads/main.zip) [![github/license](https://img.shields.io/github/license/NapoII/netcup_egg_tracker)](https://github.com/NapoII/netcup_egg_tracker/blob/main/LICENSE) [![github/last-commit](https://img.shields.io/github/downloads/NapoII/netcup_egg_tracker/total)](https://img.shields.io/github/issues/NapoII/netcup_egg_tracker?style=plastic) [![github/issues_open](https://img.shields.io/github/issues/NapoII/netcup_egg_tracker?style=plastic)](https://img.shields.io/github/issues-raw/NapoII/netcup_egg_tracker) [![github/stars](https://img.shields.io/github/stars/NapoII/netcup_egg_tracker?style=social)](https://github.com/NapoII/netcup_egg_tracker/stargazers) [![discord](https://img.shields.io/discord/190307701169979393)](https://discord.gg/knTKtKVfnr)

🐰🥚 Willkommen zur großen Oster-Eiersuche auf der Sonderangebotsseite von www.netcup.de! Dieses spezielle Python-Skript durchstöbert die Seite nach versteckten Osterangeboten und speichert sie in Textdateien. 🐣🌼 Automatische Aktualisierung alle 2 Minuten, damit Sie keine versteckten Schätze verpassen! 🔄🔎

Besuchen Sie [napo-ii.de](http://napo-ii.de/) für den Live-Tracker mit den aktuellen Eggs vom Netcup-Event.


## 📝 Table of Contents
+ [Demo / Working](#demo)
+ [Install](#install)
+ [How it works](#useage)
+ [LICENSE](#license)
+ [Install](#usage)
+ [How it works](#Use)
+ [Buy me a coffee](#coffee)
+ [LICENSE](#LICENSE)
## 🎥 Demo / Working <a name = "demo"></a>
![BSP](https://raw.githubusercontent.com/NSG22/netcup_egg_tracker/main/README_img/demo.png)

## 💻 Install <a name = "install"></a>

## 💻 Install <a name = "usage"></a>
```cmd
git clone https://github.com/NSG22/netcup_egg_tracker.git
git clone https://github.com/NapoII/netcup_egg_tracker
pip install -r requirements.txt
```
## 💭 How it works <a name = "useage"></a>
## 💭 How it works <a name = "Use"></a>

start netcup_egg_tracker.py directly from the folder or run in cmd:
```cmd
Expand All @@ -29,8 +37,20 @@ python netcup_egg_tracker.py
- Die Dateinamen enthalten den Preis und die Produktinformationen, um die Angebote leicht identifizieren zu können.
- Stellen Sie sicher, dass das Skript über die erforderlichen Berechtigungen zum Schreiben von Dateien im aktuellen Verzeichnis verfügt.

## 📚 LICENSE <a name = "license"></a>
## ☕ Buy me a coffee <a name = "coffee"></a>

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! 🚀

<a href='https://ko-fi.com/M4M0TS4ZM' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://storage.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>

## 📚 LICENSE <a name = "LICENSE"></a>

[GNU GENERAL PUBLIC LICENSE Version 3](LICENSE)

[netcup_egg_tracker](netcup_egg_tracker) was created on 31.March.2024 by [NapoII](https://github.com/NapoII)



<p align="center">
<img src="https://raw.githubusercontent.com/NapoII/NapoII/233630a814f7979f575c7f764dbf1f4804b05332/Bottom.svg" alt="Github Stats" />
</p>
Binary file modified README_img/Readme_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions netcup_egg_tracker/netcup_egg_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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]
Expand All @@ -63,30 +65,29 @@ 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']}"
egg['found_url'] = f"https://www.netcup.de{r}" # Hinzufügen der gefundenen URL
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}")
print(f"{egg['original_url']}")
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()

0 comments on commit 1735176

Please sign in to comment.