This commit is contained in:
2025-01-13 18:19:28 +01:00
parent 78729cdbe2
commit 42ab6c073a
2 changed files with 15 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
### Genera una pagina html con il link aggiornato di streamingcommunity
```
# Per generare la pagina index.html contente il link giusto:
# Per generare la pagina index.html contente il link giusto (richiede "attuale.txt"):
# 1. Avvia lo script manualmente
./update_link.sh
@@ -11,6 +11,10 @@
#Se vuoi pubblicarla sul web, dai i permessi alla cartella contenente lo script:
sudo chown -R www-data:www-data <path_to_streamingcommunity_directory> ; sudo chmod -R 755 <path_to_streamingcommunity_directory>
```
```
# Se vuoi semplicemente sapere qual'è il link giusto aggiornato esegui "script_link.sh" (richiede "attuale.txt"):
./script_link.sh
```

View File

@@ -1,4 +1,9 @@
attuale=$(<attuale.txt)
nuovo=$(curl -L $attuale | grep -oP '(?<=<strong>).*?(?=</strong></span></p>)' | grep -oP 'https://streamingcommunity.*')
echo "$nuovo" > attuale.txt
echo -e "\n$nuovo\n"
#!/bin/bash
attuale=$(<$PWD/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
attuale="$nuovo"
echo "$attuale" > $PWD/attuale.txt
fi
echo -e "\n $attuale\n"