+<?php
+require_once __DIR__ . '/../data/config.php';
+require_once __DIR__ . '/functions.php';
+header('Content-type: application/atom+xml');
+header('Link: <' . $hub . '>; rel="hub"');
+header('Link: <' . $self . 'feed.php>; rel="self"', false);
+
+$articles = loadArticles();
+reset($articles);
+$lastUpdate = key($articles);
+?>
+<?xml version="1.0" encoding="utf-8" ?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>WebSub tester</title>
+ <author>
+ <name>Someone</name>
+ <email>someone@example.org</email>
+ </author>
+ <link href="<?php echo $self; ?>"/>
+ <link rel="self" href="<?php echo $self; ?>feed.php"/>
+ <link rel="hub" href="<?php echo $hub; ?>"/>
+ <link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" />
+ <id><?php echo $self; ?>feed.php</id>
+ <updated><?php echo date('c', $lastUpdate); ?></updated>
+
+ <?php foreach ($articles as $article) { ?>
+ <entry>
+ <id><?php echo $article->file; ?></id>
+ <title><?php echo htmlspecialchars($article->title); ?></title>
+ <published><?php echo date('c', $article->time); ?></published>
+ <updated><?php echo date('c', $article->time); ?></updated>
+ <summary><?php echo substr($article->content, 0, 100); ?>…</summary>
+ <content type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ <?php echo $article->content; ?>
+ </div>
+ </content>
+ <link rel="alternate" type="text/html" href="<?php echo $self . $article->file; ?>" />
+ </entry>
+ <?php } ?>
+</feed>