2 require_once __DIR__ . '/../data/config.php';
3 header('Link: <' . $hub . '>; rel="hub"');
4 header('Link: <' . $self . '>; rel="self"', false);
6 $files = glob(__DIR__ . '/articles/*.htm');
8 foreach ($files as $file) {
9 $content = file_get_contents($file);
10 $xml = simplexml_load_string($content);
11 $timestamp = strtotime(basename($file, '.htm'));
12 $articles[$timestamp] = (object) array(
13 'file' => 'articles/' . basename($file),
14 'title' => basename($file, '.htm'),
15 'content' => (string) $xml->body->div,
21 <html xmlns="http://www.w3.org/1999/xhtml">
23 <title>PubSubHubbub tester</title>
27 <a href="add-article.php">create new article</a>
30 <?php foreach ($articles as $article) { ?>
31 <article class="h-entry">
32 <h2><?php echo htmlspecialchars($article->title); ?></h2>
33 <div class="e-content">
34 <?php echo $article->content; ?>
37 <a href="<?php echo $article->file; ?>" class="u-url">permalink</a>
38 <time class="dt-published"><?php echo date('c', $article->time); ?></time>