This is a great Script made by Imed CHIHI, let doing statistic over progressing information on a Web Page:

 


$ while :
do
... date +%Y' '%m' '%d' '%H' '%M' '%S >> results.txt
links -dump '
http://www.mosaiquefm.net/poll/popup.php?action=results&poll_ident=1430' | grep -A2 Pour >> results.txt
sleep 30
done

$ cat results.txt | awk '/2012.*/ {ORS=""; print $1"-"$2"-"$3"T" $4":"$5":"$6" "}
/.*Pour.*/ {print $4" "}
/.*Contre.*/ {print $4 "\n"}' | sed -e 's/(//g' -e 's/)//g' > results

$ echo 'set terminal png size 1200,800; set xlabel "Temps"; set ylabel "Votes"; set output "results.png"; set xdata time; set xtic rotate by 270; set timefmt "%Y-%m-%dT%H:%M:%S"; set autoscale; set style line 1 linetype 1 linecolor rgb "red"; set style line 2 linetype 1 linecolor rgb "green"; plot "results" using 1:2 with lines ls 2 title "Pour", "./results" using 1:3 with lines ls 1 title "Contre"' | gnuplot
Afficher la suite