aboutsummaryrefslogtreecommitdiff
path: root/txt/index.php
blob: b983b47e32258af43dc2083f91a04fb716a12991 (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 lang="en">
  <head>
    <?php include("../boilerplate.php"); ?>
    <title>/inf/license</title>
    <meta name="description" content="licensing">
  </head>
 <body>
  <nav><a href="../"><<<</a></nav>
  <p>$ pwd</p>
  <h1 class="title">/log/txt</h1>
  <p>$ cat sys.log</p>
  <main 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;
    ?>
  </main>
  <p>$</p>
  </body>

</html>