From 84fe05d110763f5126a80d023bffc975ac51837a Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Thu, 12 Feb 2026 17:11:59 +0200 Subject: [PATCH] p2 --- project2/famousquotes.py | 6 +++--- project2/jenkinsfile | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project2/famousquotes.py b/project2/famousquotes.py index 21cda87..dfd87b0 100644 --- a/project2/famousquotes.py +++ b/project2/famousquotes.py @@ -2,7 +2,7 @@ import requests def get_quote(): try: - # Folosim API-ul Quotable pentru a primi și autorul + # Schimbăm la Quotable pentru a primi autorul response = requests.get("https://api.quotable.io/random", timeout=10) response.raise_for_status() data = response.json() @@ -10,13 +10,13 @@ def get_quote(): quote = data.get('content', 'No quote found') author = data.get('author', 'Unknown') - # Salvăm formatat pentru Discord + # Formatăm textul care va ajunge pe Discord with open("quote.txt", "w", encoding="utf-8") as f: f.write(f"📜 *\"{quote}\"*\n\n✍️ **Autor:** {author}") except Exception as e: with open("quote.txt", "w", encoding="utf-8") as f: - f.write(f"⚠️ Nu am putut prelua citatul. Eroare: {str(e)}") + f.write(f"⚠️ Eroare la preluare: {str(e)}") if __name__ == "__main__": get_quote() \ No newline at end of file diff --git a/project2/jenkinsfile b/project2/jenkinsfile index 69f76cf..338ff72 100644 --- a/project2/jenkinsfile +++ b/project2/jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { script { dir('project2') { - sh "docker build -t quotes-app ." + sh "docker build --no-cache -t quotes-app ." echo "🔍 Verificăm sintaxa codului..." sh "docker run --rm quotes-app python -m py_compile famousquotes.py" }