feat: Semaine 8

This commit is contained in:
gauvainboiche
2026-05-11 09:25:19 +02:00
parent 606e43e53f
commit 3315cb2336
123 changed files with 5748 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import feedparser, requests
# L'architecture vient couper le couplage FORT
RSS_URL = "https://www.nasa.gov/rss/dyn/breaking_news.rss"
SLACK_WEBHOOK = "https://hooks.slack.com/services/your/webhook/url"
KEYWORDS = ["NASA", "space", "launch"]
def run():
feed = feedparser.parse(RSS_URL)
for entry in feed.entries:
title = entry.title.lower()
matched_keywords = [kw for kw in KEYWORDS if kw.lower() in title]
if matched_keywords:
message = (
f"**New NASA news**: {entry.title}\n"
f"Link: {entry.link}"
)
requests.post(SLACK_WEBHOOK, json={"text": message})
print(f"Posted to Slack: {entry.title}")
if __name__ == "__main__":
run()