add stats
This commit is contained in:
@@ -1 +1 @@
|
||||
streamingcommunity.ooo
|
||||
streamingcommunity.paris
|
||||
|
||||
@@ -64,17 +64,18 @@ cat <<- _EOF > $PWD_SC/index.html
|
||||
height: 200wj;
|
||||
}
|
||||
|
||||
|
||||
h1 {
|
||||
font-size: 36px;
|
||||
/* Default size */
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
h1 {
|
||||
font-size: 17px;
|
||||
/* Size mobile phones */
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 480px) {
|
||||
h3 {
|
||||
font-size: 15px;
|
||||
@@ -83,16 +84,15 @@ cat <<- _EOF > $PWD_SC/index.html
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="link">
|
||||
<h3> Link aggiornato per Streaming Community: </h3>
|
||||
<h1> <a href=$formatted>$formatted </a> </h1>
|
||||
<h3> (cambia circa una volta al mese) </h3>
|
||||
<h5> link2stats of sc: <a href=./stats1.html>stats1</a> e <a href=./stats2.html>stats2 </a> </h5>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
@@ -107,15 +107,17 @@ cat <<- _EOF > $PWD_SC/index.html
|
||||
<h3> Link aggiornato per Streaming Community: </h3>
|
||||
<h1> <a href=$formatted> $formatted </a> </h1>
|
||||
<h3> (cambia circa una volta al mese) </h3>
|
||||
<h5> link2stats of sc: <a href=./stats1.html>stats1</a> e <a href=./stats2.html>stats2 </a> </h5>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
_EOF
|
||||
|
||||
# Genera le stats scrapate da streaming community sui client più altre cose da capire
|
||||
./make_stats.sh
|
||||
|
||||
# Da i permessi alla cartella (decommentare se hostato)
|
||||
#sudo chown -R www-data:www-data $PWD_SC ; sudo chmod -R 755 $PWD_SC
|
||||
121
make_index_without_stats.sh
Normal file
121
make_index_without_stats.sh
Normal file
@@ -0,0 +1,121 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SETTARE QUESTA VARIABILE CON IL PERCORSO GIUSTO:
|
||||
# Es: PWD_SC="/var/www/html/streamingcommunity"
|
||||
PWD_SC="$PWD"
|
||||
|
||||
# Segue link per vedere se è stato aggiornato...
|
||||
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+)?')
|
||||
|
||||
# Se il nuovo link è diverso dal nuovo, allora...
|
||||
if [ "$attuale" != "$nuovo" ]; then
|
||||
# se è vuoto lascia il vecchio
|
||||
if [ -z "$nuovo" ]; then
|
||||
echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK"
|
||||
else
|
||||
# Se non è vuoto lo aggiorna con il nuovo link il file attuale.txt
|
||||
attuale="$nuovo"
|
||||
echo "$attuale" > $PWD_SC/attuale.txt
|
||||
fi
|
||||
else
|
||||
# se il link giusto è ancora il vecchio lascia il vecchio
|
||||
echo "Il link giusto è ancora il vecchio"
|
||||
fi
|
||||
|
||||
|
||||
# Formatta il link e lo stampa
|
||||
formatted="https://$(cat "$PWD_SC/attuale.txt")"
|
||||
echo "$formatted"
|
||||
|
||||
# Crea pagina "index.html"
|
||||
cat <<- _EOF > $PWD_SC/index.html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>StreamingCommunity Link Giusto</title>
|
||||
<style>
|
||||
body {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 4wh;
|
||||
border: 10px solid #ccc;
|
||||
background-color: #f4f4f4;
|
||||
}
|
||||
|
||||
div {
|
||||
width: 200wj;
|
||||
height: 200wj;
|
||||
background-color: #fbfbfb;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 90%;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
a {
|
||||
width: 300wj;
|
||||
height: 200wj;
|
||||
}
|
||||
|
||||
|
||||
h1 {
|
||||
font-size: 36px;
|
||||
/* Default size */
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
h1 {
|
||||
font-size: 17px;
|
||||
/* Size mobile phones */
|
||||
}
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
h3 {
|
||||
font-size: 15px;
|
||||
/* Size mobile phones */
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="link">
|
||||
<h3> Link aggiornato per Streaming Community: </h3>
|
||||
<h1> <a href=$formatted>$formatted </a> </h1>
|
||||
<h3> (cambia circa una volta al mese) </h3>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<a href=$formatted target="_blank">
|
||||
<img style="display:block; margin-left: auto; margin-right: auto" src="./splash.gif">
|
||||
</a>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="link">
|
||||
<h3> Link aggiornato per Streaming Community: </h3>
|
||||
<h1> <a href=$formatted> $formatted </a> </h1>
|
||||
<h3> (cambia circa una volta al mese) </h3>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
</center>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
_EOF
|
||||
|
||||
# Da i permessi alla cartella (decommentare se hostato)
|
||||
#sudo chown -R www-data:www-data $PWD_SC ; sudo chmod -R 755 $PWD_SC
|
||||
5
make_stats.sh
Executable file
5
make_stats.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -L http://52.203.236.205:8080/ -o stats1.html
|
||||
curl -L http://52.203.236.205:8080/ -o stats2.html
|
||||
|
||||
Reference in New Issue
Block a user