first commit
This commit is contained in:
commit
3452bb8e03
16
oe3.csv
Normal file
16
oe3.csv
Normal file
@ -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
|
|
28
oe3/start.sh
Executable file
28
oe3/start.sh
Executable file
@ -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
|
12
oe3/temp_output.csv
Normal file
12
oe3/temp_output.csv
Normal file
@ -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
|
|
Loading…
x
Reference in New Issue
Block a user