This commit is contained in:
Ionel Andrei Cataon
2026-02-12 17:11:59 +02:00
parent 9d8d3bacc2
commit 84fe05d110
2 changed files with 4 additions and 4 deletions

View File

@@ -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()

View File

@@ -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"
}