Improve Telegram notifications and fix data paths
- Enhanced Telegram message format to show TOP 3 by Confidence AND Quality - Added average statistics (Confidence & Quality) to notifications - Fixed hardcoded iCloud path in generator (now uses --data-dir parameter) - Updated AlleEurojackpotzahlen.csv with latest draw (Jan 9) - Added run_update_and_learn.sh wrapper script - Created com.eurojackpot.update.plist for automated updates Benefits: - Better tip selection with dual metrics visibility - Generator now works with correct project paths - More robust automation setup Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -914,3 +914,4 @@ datum;Z1;Z2;Z3;Z4;Z5;SZ1;SZ2
|
||||
2025-12-26;15;21;26;29;42;4;12
|
||||
2026-01-02;10;15;29;34;38;2;9
|
||||
2026-01-06;21;23;30;33;38;8;12
|
||||
2026-01-09;1;17;19;25;41;6;12
|
||||
|
||||
|
@@ -125,6 +125,13 @@
|
||||
"file": "weekly_tips_20260108_090029.csv",
|
||||
"avg_confidence": 0.49425787623829,
|
||||
"avg_quality": 0.6145839981272502
|
||||
},
|
||||
{
|
||||
"timestamp": "2026-01-12T21:00:15.818890",
|
||||
"num_tips": 10,
|
||||
"file": "weekly_tips_20260112_210015.csv",
|
||||
"avg_confidence": 0.49425787623829,
|
||||
"avg_quality": 0.6145839981272502
|
||||
}
|
||||
]
|
||||
}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
cd "/Users/sebastianfrohlich/Projekte/Eurojackpot"
|
||||
source venv/bin/activate
|
||||
python scripts/automation/auto_update_and_learn.py
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.eurojackpot.update</string>
|
||||
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/Users/sebastianfrohlich/Projekte/Eurojackpot/run_update_and_learn.sh</string>
|
||||
</array>
|
||||
|
||||
<key>StartCalendarInterval</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>Weekday</key>
|
||||
<integer>3</integer>
|
||||
<key>Hour</key>
|
||||
<integer>8</integer>
|
||||
<key>Minute</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Weekday</key>
|
||||
<integer>6</integer>
|
||||
<key>Hour</key>
|
||||
<integer>8</integer>
|
||||
<key>Minute</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<key>WorkingDirectory</key>
|
||||
<string>/Users/sebastianfrohlich/Projekte/Eurojackpot</string>
|
||||
|
||||
<key>StandardOutPath</key>
|
||||
<string>/Users/sebastianfrohlich/Projekte/Eurojackpot/logs/update_stdout.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/Users/sebastianfrohlich/Projekte/Eurojackpot/logs/update_stderr.log</string>
|
||||
|
||||
<key>RunAtLoad</key>
|
||||
<false/>
|
||||
|
||||
<key>EnvironmentVariables</key>
|
||||
<dict>
|
||||
<key>PATH</key>
|
||||
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
|
||||
<key>LANG</key>
|
||||
<string>de_DE.UTF-8</string>
|
||||
</dict>
|
||||
|
||||
<key>LaunchOnlyOnce</key>
|
||||
<false/>
|
||||
|
||||
<key>Nice</key>
|
||||
<integer>10</integer>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1673,14 +1673,21 @@ def main():
|
||||
print("⚡ OPTIMIZED VERSION with Progress Indicators")
|
||||
print("=" * 70)
|
||||
|
||||
data_path = "/Users/sebastianfrohlich/Library/Mobile Documents/com~apple~CloudDocs/Jupyter Notebooks/AlleEurojackpotzahlen.csv"
|
||||
# Use --data-dir parameter or default to Projekte path
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--data-dir', type=str, default="/Users/sebastianfrohlich/Projekte/Eurojackpot/data")
|
||||
parser.add_argument('--num-tips', type=int, default=10)
|
||||
args = parser.parse_args()
|
||||
|
||||
data_path = os.path.join(args.data_dir, "AlleEurojackpotzahlen.csv")
|
||||
|
||||
try:
|
||||
# Initialize with fast mode
|
||||
generator = UltimateAIMLEurojackpotGenerator(data_path, fast_mode=True)
|
||||
|
||||
# Generate Tips
|
||||
tips = generator.generate_ultimate_tips(10)
|
||||
tips = generator.generate_ultimate_tips(args.num_tips)
|
||||
|
||||
if tips:
|
||||
print("\n🏆 GENERATION COMPLETED!")
|
||||
|
||||
+37
-13
@@ -60,24 +60,41 @@ class EurojackpotNotifier:
|
||||
"""
|
||||
subject = f"🎲 {len(tips)} neue Eurojackpot-Tipps generiert!"
|
||||
|
||||
# Sortiere Tips nach Confidence
|
||||
sorted_tips = sorted(tips, key=lambda x: x.get('confidence', 0), reverse=True)
|
||||
# Statistiken
|
||||
avg_conf = sum(t.get('confidence', 0) for t in tips) / len(tips) if tips else 0
|
||||
avg_qual = sum(t.get('quality', 0) for t in tips) / len(tips) if tips else 0
|
||||
|
||||
# Top 5 formatieren
|
||||
top5_text = ""
|
||||
for i, tip in enumerate(sorted_tips[:5], 1):
|
||||
# Top 3 nach Confidence
|
||||
sorted_by_conf = sorted(tips, key=lambda x: x.get('confidence', 0), reverse=True)[:3]
|
||||
top3_conf_text = ""
|
||||
for i, tip in enumerate(sorted_by_conf, 1):
|
||||
emoji = "🥇" if i == 1 else "🥈" if i == 2 else "🥉"
|
||||
main = tip.get('main_numbers', '?')
|
||||
euro = tip.get('euro_numbers', '?')
|
||||
conf = tip.get('confidence', 0)
|
||||
strat = tip.get('strategy', 'UNKNOWN')
|
||||
qual = tip.get('quality', 0)
|
||||
strat = tip.get('strategy', 'UNKNOWN')
|
||||
|
||||
# Emoji basierend auf Rang
|
||||
emoji = "🏆" if i == 1 else "🥈" if i == 2 else "🥉" if i == 3 else "⭐"
|
||||
|
||||
top5_text += f"""{emoji} #{i} - Confidence: {conf:.2%}
|
||||
top3_conf_text += f"""{emoji} #{i} - Conf: {conf:.2%} | Q: {qual:.3f}
|
||||
🔢 {main} + ⭐ {euro}
|
||||
📈 {strat} | Quality: {qual:.3f}
|
||||
📈 {strat}
|
||||
|
||||
"""
|
||||
|
||||
# Top 3 nach Quality
|
||||
sorted_by_qual = sorted(tips, key=lambda x: x.get('quality', 0), reverse=True)[:3]
|
||||
top3_qual_text = ""
|
||||
for i, tip in enumerate(sorted_by_qual, 1):
|
||||
emoji = "🥇" if i == 1 else "🥈" if i == 2 else "🥉"
|
||||
main = tip.get('main_numbers', '?')
|
||||
euro = tip.get('euro_numbers', '?')
|
||||
conf = tip.get('confidence', 0)
|
||||
qual = tip.get('quality', 0)
|
||||
strat = tip.get('strategy', 'UNKNOWN')
|
||||
|
||||
top3_qual_text += f"""{emoji} #{i} - Q: {qual:.3f} | Conf: {conf:.2%}
|
||||
🔢 {main} + ⭐ {euro}
|
||||
📈 {strat}
|
||||
|
||||
"""
|
||||
|
||||
@@ -87,9 +104,16 @@ class EurojackpotNotifier:
|
||||
📊 Anzahl Tipps: {len(tips)}
|
||||
⏰ Zeitpunkt: {timestamp}
|
||||
|
||||
🏆 TOP 5 EMPFEHLUNGEN:
|
||||
📊 STATISTIKEN:
|
||||
🎯 Ø Confidence: {avg_conf:.4f}
|
||||
💎 Ø Quality: {avg_qual:.4f}
|
||||
|
||||
🎯 TOP 3 NACH CONFIDENCE:
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
{top5_text}
|
||||
{top3_conf_text}
|
||||
💎 TOP 3 NACH QUALITY:
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
{top3_qual_text}
|
||||
💡 Alle 10 Tipps findest du in der CSV-Datei!
|
||||
|
||||
Viel Glück! 🍀
|
||||
|
||||
Reference in New Issue
Block a user