From 8ba11bfccc0cb6574e5c7b2cbe812cf3c24852fd Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 24 Mar 2025 09:19:24 +0100 Subject: [PATCH] fix: news api call --- cazette.md | 0 generate-newsletter.sh | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 cazette.md diff --git a/cazette.md b/cazette.md new file mode 100644 index 0000000..e69de29 diff --git a/generate-newsletter.sh b/generate-newsletter.sh index 2eb2b27..53c556d 100755 --- a/generate-newsletter.sh +++ b/generate-newsletter.sh @@ -131,7 +131,7 @@ function include_news_api_latest_week { local query=$2 local total=$3 local since=$(date -d '- 7 days' +%Y-%m-%d) - local news_of_the_week=$(scrape -sk --retry 5 -H "X-Api-Key: ${NEWS_API_KEY}" -H 'User-Agent: Cazette/1.0' "https://api.newsdatahub.com/v1/news?language=fr&topic=technology&topic=business&topic=politics&topic=education&topic=innovation&topic=internet&q=${query}&start_date=${since}" | jq '.data') + local news_of_the_week=$(scrape -sk --retry 5 -H "X-Api-Key:${NEWS_API_KEY}" -H 'User-Agent:Cazette/1.0' "https://api.newsdatahub.com/v1/news?language=fr&topic=technology&topic=business&topic=politics&topic=education&topic=innovation&topic=internet&q=${query}&start_date=${since}" | jq '.data') if [ -z "$news_of_the_week" ]; then return