Page MenuHomeGitPull.it

No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
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 @@
+<?php
+# Copyright (C) 2018-2026 Valerio Bozzolan
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+/**
+ * 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 @@
+<?php
+# Copyright (C) 2018-2026 Valerio Bozzolan
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+require __DIR__ . '/../functions.php';
+
+header('Content-Type: text/html; charset=utf-8');
+?>
+<!DOCTYPE html>
+<html>
+<head>
+ <title>OrfanizzaBot</title>
+ <meta name="robots" value="noindex" />
+ <style>
+ textarea {
+ width: 90%;
+ min-height:300px;
+ }
+ </style>
+</head>
+<body>
+ <h1>OrfanizzaBot</h1>
+ <p>In seguito le ultime 200 righe di log di output dall'<a href="https://it.wikipedia.org/wiki/Utente:OrfanizzaBot">OrfanizzaBot</a> che gira in Wikimedia Toolforge.</p>
+ <p>Ogni esecuzione che si conclude con successo è circondata da <code>start</code> ed <code>end</code>. Fra ogni esecuzione vi dovrebbe essere massimo qualche minuto.</p>
+ <textarea readonly><?php echo
+ "[...]\n" .
+ htmlentities(tail('/data/project/itwiki-orfanizzabot/itwiki-orphanizerbot.out', 200))
+ ?></textarea>
+</body>
+</html>

File Metadata

Mime Type
text/x-diff
Expires
Thu, Nov 19, 02:08 (19 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2263788
Default Alt Text
(3 KB)

Event Timeline