<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bin-Blog &#187; XML</title>
	<atom:link href="http://www.bin-co.com/blog/category/xml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bin-co.com/blog</link>
	<description>Learn about the latest in Web Development - as soon as I do.</description>
	<lastBuildDate>Tue, 13 Oct 2009 18:55:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Rules for Creating an RSS Feed</title>
		<link>http://www.bin-co.com/blog/2008/07/rules-for-creating-an-rss-feed/</link>
		<comments>http://www.bin-co.com/blog/2008/07/rules-for-creating-an-rss-feed/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 17:51:29 +0000</pubDate>
		<dc:creator>Binny V A</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[rule]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.bin-co.com/blog/?p=117</guid>
		<description><![CDATA[Some rules for creating an RSS feed.]]></description>
			<content:encoded><![CDATA[<p><a href='http://feeds.feedburner.com/bin-blog'><img src="http://www.bin-co.com/blog/wp-content/uploads/2008/07/rss_feed.png" alt="" title="RSS Feed" width="158" height="158" class="alignnone size-full wp-image-118 intro" align="right" /></a></p>
<p class="intro">Most of us don&#8217;t have to worry about creating an RSS feed for our sites &#8211; the <abbr title="Content Management System">CMS</abbr> tool will do that automatically. But there are times when you are creating a custom application &#8211; when you have to create an RSS feed yourself. Creating it is easy &#8211; they don&#8217;t call it <strong>Really Simple</strong> Syndication for nothing. But there are a few rules(or rather, guidelines) that are ignored by most &#8211; make sure you follow them.</p>
<p>I am by no means an expert on this format &#8211; but I have created <a href="http://www.openjs.com/rss.php?no_redirect=1">RSS feeds</a> and have <a href="http://www.bin-co.com/blog/2008/02/alertle-launched/">worked</a> on  <a href="http://www.alertle.com/">applications</a> to <a href="http://www.bin-co.com/php/scripts/xml2array/">parse</a> it. So I have seen my share of bad implementations.</p>
<h2>Use RSS rather than Atom</h2>
<p>I prefer using <a href="http://en.wikipedia.org/wiki/RSS_(file_format)">RSS</a> as opposed to the <a href="http://en.wikipedia.org/wiki/Atom_(standard)">Atom format</a>. But Atom is now supported on almost all feed readers &#8211; so this preference may change. But for now, I like RSS better than Atom.</p>
<h2>Last-Modified</h2>
<p>Make sure your feed has the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29">last modified header</a>. This will prevent unnecessary downloading of the feed if there are no new articles. It <a href="http://feedparser.org/docs/http-etag.html">saves both the site&#8217;s and the user&#8217;s bandwidth</a>.</p>
<p>This is extremely easy in PHP&#8230;</p>
<pre><code class="php">$last_edited = '2008-07-17 01:02:03'; // This should be the time of the latest post.
header("Last-Modified: " . date('r',strtotime($last_edited)));</code></pre>
<h2>10 Posts</h2>
<p>Make sure you provide a limited number of posts in the feed &#8211; the perfect number, in my opinion, is 10. It can increase or decrease a bit &#8211; its no big deal. If your posting frequency is high, the number should increase. And if the frequency is low, the number of items in the feed can go down.</p>
<p>But make sure that you are not including all the posts from the beginning of time until now. This is a big waste of bandwidth. Unfortunately, many have adopted this method. For example, take this feed &#8211; <a href="http://www.catandgirl.com/rss.php">Cat and Girl Comic feed</a>.</p>
<p>The other extream is just as bad &#8211; providing just the latest item in the feed. If the author writes two posts in quick succession, the viewers may not get an article. An example for this in the <a href="http://www.viruscomix.com/rss.xml">subnormality comic</a>.</p>
<h2>Validate it</h2>
<p>XML is not as forgiving as HTML &#8211; so make sure you <a href="http://www.feedvalidator.org/">validate your feed</a> before releasing it upon the world.</p>
<h2>Use FeedBurner</h2>
<p>When it comes to deployment, using <a href="http://www.feedburner.com/fb/a/home">FeedBurner</a> is a better option that using your own server. In addition to its statistics, it will also act as a <abbr title="Content Distribution Network">CDN</abbr> lowering the load on your server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bin-co.com/blog/2008/07/rules-for-creating-an-rss-feed/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

