Skip to content

Instantly share code, notes, and snippets.

@ctrl-freak
Created November 21, 2011 03:00
Show Gist options
  • Save ctrl-freak/1381485 to your computer and use it in GitHub Desktop.
Save ctrl-freak/1381485 to your computer and use it in GitHub Desktop.
RSS Template
<?='<?'?>xml version="1.0"<?='?>'?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><?=$config['site']['name']?></title>
<link><?=$config['site']['url']?></link>
<description><?=$config['site']['name']?> Feed</description>
<language>en-us</language>
<pubDate><?=$items[0]['pubDate']?></pubDate>
<lastBuildDate><?=$items[0]['pubDate']?></lastBuildDate>
<atom:link href="<?=$rss['self']?>" rel="self" type="application/rss+xml" />
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator></generator>
<managingEditor><?=$config['site']['email']?> (<?=$config['site']['name']?> Editor)</managingEditor>
<webMaster><?=$config['site']['email']?> (<?=$config['site']['name']?> Webmaster)</webMaster>
<? foreach ($items as $item): ?>
<item>
<title><?=$item['title']?></title>
<link><?=$item['link']?></link>
<description><?=htmlentities($item['description'])?></description>
<pubDate><?=$item['pubDate']?></pubDate>
<guid><?=$item['link']?></guid>
</item>
<? endforeach; ?>
</channel>
</rss>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment