aboutsummaryrefslogtreecommitdiffhomepage
path: root/routes/global_timeline.php
blob: c32419c2143828c534bd05ed7fd7f40f436b96a4 (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
<?php

use Digitigrade\Router;
use Digitigrade\Timeline\GlobalTimeline;

Router::getInstance()->mount('/feed/global', function (array $args) {
    $notes = (new GlobalTimeline())->getNotes();
    ?>
    <!DOCTYPE html>
    <html lang="en">

    <head>
        <title>digitigrade global timeline</title>
    </head>

    <body>
        <h1>Global timeline</h1>
        <?php foreach ($notes as $n): ?>
            <div style="margin: 8px; padding: 8px; border: 1px solid">
                <b><?= $n->author->displayName ?></b> <small><?= $n->author->uri ?></small><br>
                <p><?= $n->plainContent ?></p>
                <small><?= $n->created->format('c') ?></small>
            </div>
        <?php endforeach; ?>
    </body>

    </html>
    <?php
});