commit 3452bb8e037353beb5e9675552425e91c5c58030 Author: titanz Date: Wed Jan 8 12:37:17 2025 +0100 first commit diff --git a/oe3.csv b/oe3.csv new file mode 100644 index 0000000..a14f956 --- /dev/null +++ b/oe3.csv @@ -0,0 +1,16 @@ +startISO;interpreter;title +2025-01-08T12:07:25+01:00;Shakira / Freshlyground;Waka Waka (This Time for Africa) +2025-01-08T12:10:34+01:00;Michael Jackson;Billie Jean +2025-01-08T12:14:43+01:00;David Guetta, Alphaville & Ava Max;Forever Young +2025-01-08T12:17:23+01:00;Linkin Park;Numb +2025-01-08T12:20:24+01:00;Lady Gaga;The Edge of Glory +2025-01-08T12:24:37+01:00;RIAN;Verwandtschaftstreffen +2025-01-08T12:30:27+01:00;The Police;Every Breath You Take +2025-01-08T12:36:27+01:00;Lemo;Träum +2025-01-08T12:39:53+01:00;Dasha;Austin +2025-01-08T12:30:28+01:00;Katy Perry;Hot n Cold +2025-01-08T12:34:01+01:00;The Police;Every Breath You Take +2025-01-08T12:36:00+01:00;Avicii;Wake Me Up! +2025-01-08T12:36:54+01:00;George Ezra;Hold My Girl +2025-01-08T12:40:12+01:00;Lemo;Träum +2025-01-08T12:43:39+01:00;Dasha;Austin diff --git a/oe3/start.sh b/oe3/start.sh new file mode 100755 index 0000000..afa43d9 --- /dev/null +++ b/oe3/start.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# file in which data got stored +OUTPUT_FILE="../oe3.csv" + +# temp file for new data +TEMP_FILE="temp_output.csv" + +# if file not exist, create and add header +if [ ! -f "$OUTPUT_FILE" ]; then + echo "startISO;interpreter;title" > "$OUTPUT_FILE" +fi + +while true; do + # call api and filter it + curl -s "https://audioapi2.orf.at/oe3/json/4.0/live?_o=oe3.orf.at" | \ + jq -r '.[].items[] | select(.interpreter != null and .title != null) | "\(.startISO);\(.interpreter);\(.title)"' > "$TEMP_FILE" + + # find new entries and add to main file + grep -Fxv -f "$OUTPUT_FILE" "$TEMP_FILE" >> "$OUTPUT_FILE" + + # debug + echo "List updated: $(date)" + + # wait 20 minutes +# sleep 1200 + sleep 300 +done diff --git a/oe3/temp_output.csv b/oe3/temp_output.csv new file mode 100644 index 0000000..0d49148 --- /dev/null +++ b/oe3/temp_output.csv @@ -0,0 +1,12 @@ +2025-01-08T12:07:25+01:00;Shakira / Freshlyground;Waka Waka (This Time for Africa) +2025-01-08T12:10:34+01:00;Michael Jackson;Billie Jean +2025-01-08T12:14:43+01:00;David Guetta, Alphaville & Ava Max;Forever Young +2025-01-08T12:17:23+01:00;Linkin Park;Numb +2025-01-08T12:20:24+01:00;Lady Gaga;The Edge of Glory +2025-01-08T12:24:37+01:00;RIAN;Verwandtschaftstreffen +2025-01-08T12:30:28+01:00;Katy Perry;Hot n Cold +2025-01-08T12:34:01+01:00;The Police;Every Breath You Take +2025-01-08T12:36:00+01:00;Avicii;Wake Me Up! +2025-01-08T12:36:54+01:00;George Ezra;Hold My Girl +2025-01-08T12:40:12+01:00;Lemo;Träum +2025-01-08T12:43:39+01:00;Dasha;Austin