diff --git a/web/functions.php b/web/functions.php new file mode 100644 index 0000000..e7edd05 --- /dev/null +++ b/web/functions.php @@ -0,0 +1,45 @@ +. + +/** + * Refresh every minute + */ +function please_refresh( $seconds = 20 ) { + header( "Refresh: $seconds" ); +} + +/** + * Return the latest $max_lines from a $filename + * + * @param $filename string File name path + * @param $max_lines int Maximum number of lines to be read + */ +function tail( $filename, $max_lines ) { + $fp = fopen( $filename, 'r' ); + fseek( $fp, -1, SEEK_END ); + $s = ''; + $n = 0; + $pos = ftell( $fp ); + while( $pos > 0 ) { + $c = fgetc( $fp ); + if( "\n" === $c && $n++ > $max_lines ) { + break; + } + $s = $c . $s; + fseek( $fp, $pos-- ); + } + fclose( $fp ); + return rtrim( $s ); +} diff --git a/web/public_html/index.php b/web/public_html/index.php new file mode 100644 index 0000000..e429a57 --- /dev/null +++ b/web/public_html/index.php @@ -0,0 +1,41 @@ +. + +require __DIR__ . '/../functions.php'; + +header('Content-Type: text/html; charset=utf-8'); +?> + + + + OrfanizzaBot + + + + +

OrfanizzaBot

+

In seguito le ultime 200 righe di log di output dall'OrfanizzaBot che gira in Wikimedia Toolforge.

+

Ogni esecuzione che si conclude con successo รจ circondata da start ed end. Fra ogni esecuzione vi dovrebbe essere massimo qualche minuto.

+ + +