aboutsummaryrefslogtreecommitdiff
path: root/stuff/webgarden/status.php
blob: 4330d31f6ef4801ab4bffa54c2a9bbbf9bdfd4a0 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Status</title>
    <link href="style.css" rel="stylesheet" type="text/css" media="all">
    <style type="text/css">
      body {
        background: #222222;
      }
      #statuscafe a {
        color: #df1955;
      }
      #statuscafe a:hover {
        color: #00ffd5;
      }
      #statuscafe {
        display: flex;
        flex-direction: column;
        position: absolute;
        left: 10px;
        top: 10px;
        height: 230px;
        width: 230px; 
        justify-content: center;
        align-items: center;
      }
      #statuscafe-content {
        margin-top: 10px;
      }
    </style>
  </head>
  <body>
    <div id="plant">
      <?php
        $username = "niceopod"; // Your username here!
        $status_data = json_decode(file_get_contents("https://status.cafe/users/$username/status.json"), true);
        $content = $status_data["content"];
        $face = $status_data["face"];
        $timeago = str_replace(" ","&nbsp;",$status_data["timeAgo"]);
        if(strlen($content) < 1) {
          $content = "No status yet.";
        }
        echo "<div id='statuscafe'><div id='statuscafe-username'><a href='https://status.cafe/users/$username' target='_blank'>$username</a> $face $timeago</div><div id='statuscafe-content'>$content</div></div>";
      ?>
      <a id="back" href="index.php" style="font-size: 2em; position: absolute; left: 4px; top: 218px;">&lt;</a>
    </div>
  </body>
</html>