blob: 034a333b07feeac4bbd585958c9f3303b9f6f371 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<!DOCTYPE html>
<html>
<head>
<?php include("boilerplate.php"); ?>
<title>/log/txt</title>
<meta name="description" content="noteworthy excerpts of log output">
</head>
<body>
<nav><a href="../"><<<</a></nav>
<p>$ pwd</p>
<h1 class="title">/log/txt</h1>
<p>$ cat sys.log</p>
<section class="dir">
<?php
$fp = "/var/www/data/deeptwisty/sys.log";
$content = file_get_contents($fp);
$post_arr = explode("\n",$content);
$posts_out = "";
date_default_timezone_set("Etc/GMT-1");
foreach($post_arr as $p) {
if(strlen($p) > 3) {
$date = substr($p, 0, strpos($p, " "));
$sdate = date(DateTime::ATOM, $date);
$hdate = date("Y-m-d@B", $date);
$pcont = substr($p, strpos($p, " ") + 1);
$posts_out = "<article><time datetime='$sdate'>$hdate</time> >> $pcont</article>$posts_out";
}
}
echo $posts_out;
?>
</section>
<p>$</p>
</body>
</html>
|