1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 11:01:07 +01:00

2 Commits

Author SHA1 Message Date
4af218f7ad radio-news: send earlier 2025-05-16 14:03:42 +02:00
b08576c972 radio-news: expire earlier 2025-05-16 10:08:30 +02:00

View File

@@ -20,7 +20,7 @@ in {
serviceConfig.LoadCredential = [
"gemini-api-key:${config.age.secrets.gemini-api-key.path}"
];
startAt = "hourly";
startAt = "*:50";
script = ''
set -efu
PATH=$PATH:${lib.makeBinPath [pkgs.w3m pkgs.gnused pkgs.curl pkgs.jq]}
@@ -36,7 +36,7 @@ in {
Summarize the following news headlines into a cohesive, engaging script under 400 words.
Keep it professional, concise, and easy to follow.
Begin the digest with: "Good news everybody! Here's your news update for $(date -u +"%B %d, %Y")..."
Begin the digest with: "Here's your news update for $(date -u +"%B %d, %Y")."
EOF
)
@@ -65,7 +65,7 @@ in {
RESPONSE=$(echo "$REQUEST" | curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-8b:generateContent?key=$GEMINI_API_KEY" -s -H "Content-Type: application/json" -d @-)
echo "$RESPONSE" | jq --arg from "$(date -u -Is | sed 's/+00:00/Z/')" --arg to "$(date -u -Is -d 'next hour' | sed 's/+00:00/Z/')" '
echo "$RESPONSE" | jq --arg from "$(date -u -Is | sed 's/+00:00/Z/')" --arg to "$(date -u -Is -d 'now + 30 minutes' | sed 's/+00:00/Z/')" '
{
from: $from,
to: $to,