rss generator update

This commit is contained in:
2025-01-19 00:58:54 +01:00
parent d366f327c0
commit 95ec6d1824
5 changed files with 23 additions and 24 deletions

View File

@@ -1,9 +1,10 @@
#!/bin/bash
# SETTARE QUESTA VARIABILE CON IL PERCORSO GIUSTO:
# Es: PWD_SC="/var/www/html/streamingcommunity"
PWD_SC="$PWD"
# Se il link è stato aggiornato, aggiorna il file "attuale.txt"
# Se il link è cambiato, allora aggiorna il file "attuale.txt"
attuale="$(cat "$PWD_SC/attuale.txt")"
nuovo=$(curl --no-progress-meter -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streamingcommunity\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streamingcommunity\.\w+(\.\w+)?')
if [ "$attuale" != "$nuovo" ]; then
@@ -13,7 +14,7 @@ fi
# Formatta il link e lo stampa
formatted="https://$(cat "$PWD_SC/attuale.txt")"
echo "$formatted" #per debug
echo "$formatted"
# Crea pagina "index.html"
cat <<- _EOF > $PWD_SC/index.html