Creating An RSS 2.0 Feed

Category: General
Reviewed by: Chiggins   
Reviewed on: Jul 31 2008
» Discuss this topic (0 Posts)

First, make a file called "feed.rss" and save it to a place where you can remember. Now in the file, add these following lines of code:

 
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
 
</channel>
</rss>

That little piece of code says that it is a valid XML document, and is an RSS 2.0 Feed. Now we will add information about the feed itself. This code goes between the tags.

 
    <title>RSS Feed Title</title>
    <link>http://127.0.0.1//</link>
    <description>This is the description of the RSS Feed</description>
    <webMaster>chris.ch1gg1ns@gmail.com</webMaster>
    <managingEditor>chris.ch1gg1ns@gmail.com</managingEditor>
    <language>en-us</language>
    <lastBuildDate>Sun, 20 Jul 2008 18:48:25 -0500</lastBuildDate>
 
    <copyright>© 2008 Your Name Here</copyright>

Most of the tags are self explanatory. The lastBuildDate on needs to contain RFC 822 compliant time information. To do that in PHP, you would just do "date( "r" , time() )". And for the webMaster and managingEditor tags, ou wouldn't have down my email address.