RSS
  1. RSS introduction
  2. RSS structure
  3. RSS tags
  4. RSS channels
  5. RSS items
  6. RSS publish
  7. RSS read
  8. RSS find
  9. RSS tools
  10. RSS Summary

RSS structure

RSS sounds great, but how can you actually implement it? To do this you need to create an RSS list (commonly known as a "feed"). RSS feeds are built using a specific format.

This tutorial focuses on:

File creation

RSS feeds are built using XML so to begin creating an RSS feed, first open a new blank page in your code editor and save it with the .xml extension.

Core declarations

Add these two lines to your file:

<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0">

The first line is the XML declaration which specifies the XML version as well as the character encoding being used. The second line is the RSS declaration which specifies that this file is an RSS document, specifically RSS 2.0

Comments

Comments in an RSS file are written the same way as they are written for HTML.

Example:
<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <!-- comment in an RSS file -->

Adding content

You've declared that your file is going to be an RSS file, now lets add some content! We will need five tags to do this - <channel>, <title>, <link>, <description>, and <item>

The <channel> tag is used to describe an RSS feed. Within the <channel> tag, the <item> tag is used for each item in the RSS feed. Both these tags have three required child tags:

Check out our RSS channels and RSS items pages for more information on <channel> and <item>.

A complete RSS file:
<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <channel> <title>Landofcode.com web tutorials updates</title> <link>http://www.landofcode.com</link> <description>Web development tutorials</description> <item> <title>Online code editor</title> <link>http://www.landofcode.com/online-code-editor.php</link> <description>New functionality added to the code editor. Check it out!</description> </item> <item> <title>Errors fixed</title> <link>http://www.landofcode.com</link> <description>Fixed a bunch of errors. Site runs much better now</description> </item> <item> <!-- add three more HTML tutorials next week--> <title>HTML tutorials</title> <link>http://www.landofcode.com/html-tutorials/</link> <description>Five new tutorials added to the HTML tutorials section.</description> </item> </channel> </rss>

NOTE: Remember to keep in mind XML syntax rules when creating RSS feeds - All tags must have a closing tag, be in lowercase, and in the correct order. All attributes must be in lowercase and attribute values must be quoted.

© Copyright 2013-2014 Landofcode.com
Terms of use | Privacy policy | Copyright information