+<?php
+require_once __DIR__ . '/../data/config.php';
+header('Link: <' . $hub . '>; rel="hub"');
+header('Link: <' . $self . '>; rel="self"', false);
+
+$files = glob(__DIR__ . '/articles/*.htm');
+$articles = array();
+foreach ($files as $file) {
+ $content = file_get_contents($file);
+ $xml = simplexml_load_string($content);
+ $timestamp = strtotime(basename($file, '.htm'));
+ $articles[$timestamp] = (object) array(
+ 'file' => 'articles/' . basename($file),
+ 'title' => basename($file, '.htm'),
+ 'content' => (string) $xml->body->div,
+ 'time' => $timestamp,
+ );
+}
+krsort($articles);
+?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>PubSubHubbub tester</title>
+ </head>
+ <body class="h-feed">
+ <p>
+ <a href="add-article.php">create new article</a>
+ </p>
+ <h1>Articles</h1>
+ <?php foreach ($articles as $article) { ?>
+ <article class="h-entry">
+ <h2><?php echo htmlspecialchars($article->title); ?></h2>
+ <div class="e-content">
+ <?php echo $article->content; ?>
+ </div>
+ <p>
+ <a href="<?php echo $article->file; ?>" class="u-url">permalink</a>
+ <time class="dt-published"><?php echo date('c', $article->time); ?></time>
+ </p>
+ </article>
+ <?php } ?>
+ </body>
+</html>