<?php
require_once __DIR__ . '/../data/config.php';
+require_once __DIR__ . '/functions.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);
+$articles = loadArticles();
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>PubSubHubbub tester</title>
+ <title>WebSub tester</title>
+ <link rel="alternate" type="application/atom+xml" title="WebSub tester" href="feed.php" />
</head>
<body class="h-feed">
<p>
<a href="add-article.php">create new article</a>
+ | <a href="feed.php">atom feed</a>
+ </p>
+ <p>
+ This is a tool to test your <a href="https://www.w3.org/TR/websub/">WebSub</a>
+ subscriber.
+ With one click, a new post gets published and the hub gets notified.
</p>
<h1>Articles</h1>
<?php foreach ($articles as $article) { ?>
</div>
<p>
<a href="<?php echo $article->file; ?>" class="u-url">permalink</a>
- <time class="dt-published"><?php echo date('c', $article->time); ?></time>
+ at <time class="dt-published"><?php echo date('c', $article->time); ?></time>
+ by
+ <span class="h-card vcard author p-author">
+ <img class="u-photo" src="someone.png" width="16" height="16" alt=""/>
+ <a class="p-author h-card" href="someone.htm">Someone</a>
+ </span>
</p>
</article>
<?php } ?>