forked from scossa/StreamingCommunity
up
This commit is contained in:
@@ -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
|
||||
```
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user