diff --git a/.gitignore b/.gitignore index 2a4e5df..2a62ece 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -make.* public_html/ diff --git a/make.bat b/make.bat new file mode 100644 index 0000000..b4aa1b1 --- /dev/null +++ b/make.bat @@ -0,0 +1,6 @@ +@echo off + +cd openring +python "openring.py" +cd .. +zola build \ No newline at end of file diff --git a/make.sh b/make.sh new file mode 100755 index 0000000..8a16c65 --- /dev/null +++ b/make.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +file="./templates/openring.html" +if [ -e "$file" ]; then + file_time=$(date -r "$file" +%s) + tempo_max=$(date -d '16 hours ago' +%s) +fi + +if [ ! -e "$file" ] || (( $file_time < $tempo_max )); then + cd openring + ./openring -S "feeds.txt" -n 5 < "in.html" > "../templates/openring.html" + ./openring_it -S "feeds-it.txt" -n 5 < "in_it.html" > "../templates/openringit.html" + cd .. +else + echo "Feed generato troppo di recente. Operazione saltata." +fi + +git add --all +git commit -S -m "Aggiornamento semi-automatico $(date +%Y-%m-%dT%H:%M:%S%Z)" +git push -u origin master + +zola build