Tuesday, June 27, 2006

Basics of Blogging Series: Part 17 - RSS - The Elements Within the "Item" Element

Cobwebs Of The Mind - RSSNow we have covered the major points in the "Channel" element, we will now cover the Item element. Hang on to your seats, but you should breeze through this part fairly easily already. Remember our purpose is to create an RSS feed template that you can use, and what is known as a "well-formed XML document" which will pass validation with flying colors! (And make you into a techie as well!)

(For the techies among us I am not going into the "dc:" tags from RSS 1.0 For those who are interested they should take a look at W3C docs on RSS 2.0 and also view the RSS 2.0 specifications.)


First to get you familiar with the lingo we will use here, these are the possible inclusions in your "Item" tag. Some of them should be familiar. Pay Attention that the syntax is NOT the same for some specifically for enclosure & source.



  1. <title></title>

  2. <link></link>

  3. <description></description>

  4. <author></author>

  5. <category></category>

  6. <comments></comments>

  7. <enclosure "information of enclosure goes here" />

  8. <guid></guid>

  9. <pubdate></pubdate>

  10. <source url="http://www.yaddayadda/yadda.rss">Babble</source>


Some of the above are simple, others can get complicated. So we will work on this step by step and in the end you will have an incredible RSS feed. Remember you do NOT need to place all of these in your feed. You can get away with the title, link & description (and you should put the pubdate in as well). HOWEVER, these are important commands and some like enclosure can open up worlds of possibilities for you.


So first the descriptions and explanations.



  1. Our Title here is the title of this item within the Channel. Remember this is our "Chapter Heading". Fairly easy. So here we would want to put, "Heaven Scent Perfume At 50% Discount." So this is how our title will read:
    <title>Heaven Scent Perfume At 50% Discount</title>

  2. Next comes our all important link. Where to find the data. So here Randy has a whole web page devoted to selling Heaven Scent perfume.
    <link>http://www.randypandy.com/perfumes/heavenscent.html</link>

  3. Okay our description is cool. Hey all we want here is to define the perfume. Right? Well, lets do that for the time being.
    <description>Heaven Scent Perfume the Smell your lover will die for.  Created especially by Skunk Perfumes it is their newest and best selling perfume on the market today. Purchase a beautifully shaped skunk bottle with this incredible perfume and get a whopping 50% off! And if you purchase over $100 we will throw in Free overnight delivery as well!</description>
    (Now don't get carried away just yet. Sure we have a description. But what if we want to get a picture in that description? What if we want the user to see in his aggregator not just words but an image as well? Well, that can be done too, BUT you will have to wait for my next installment!)

  4. Okay author is really simple stuff, except Randy Pandy's wife, Sandy, is in a huff cause she is the one who has written all the publicity material. So here we will give her credit with her email as well.
    <author>sandy@randypandy.com (Sandy Pandy - The Queen of Scent)</author>

  5. First & foremost the category term is not limited to one. You can place as many categories as your little heart desires. What is the category? Well here Randy wants to put, "Perfume" and Sandy wants to put "On-Line Shopping", and Randy's kids want to put "Skunk Perfume" cause they think it is cool. (You can even put a URL in there with an "href") So our category may look like this:
    <category>Perfume</category>
    <category>On-Line Shopping</category>
    <category>Skunk Perfume</category>
    <category domain="http://www.perfumesoftheworld.com/greatsmells">Skunks</category>

    Don't worry! For our final XML file we will just use one category.

  6. Best way to explain comments is to understand that this is URL which points to a page which is actually comments about "Heaven Scent Perfume". Randy & Sandy maintain a page for each item where clients can leave their remarks (this can also be a blog as well). So here we would put:
    <comments>http://www.randypandy.com/perfumes/comments/skunkyheavenscent.html</comments>

  7. Enclosure is the MAGIC of RSS. Pure Magic. It is what allows you to Podcast and VideoCast and do all that incredible stuff with RSS. However, this will be discussed at length in a following article. What we want to know here is that in enclosure I can put an image, a video, a voice recording etc. So let us say I want to release "Summertime" by Janis Joplin (swooning here!) in my RSS. Here is where I would put the information on the file.
    <enclosure url="http://www.randypandy.com/mp3s/janis/summertime.mp3" length="5588242" type="audio/mpeg"/>
    The Url to the file. followed by the "weight" of the file (exactly how big it is) and this goes for jpg, mpg etc. and the type of file. (Again
    we will lay all this out in another article). So far so good? But Sandy (remember her?) she does not like Janis. And besides she feels that we should put the Heaven Scent Song inside the enclosure. So our enclosure will really look like this:

    <enclosure url="http://www.randypandy.com/mp3s/heavenscentcomm.mp3" length="4368242" type="audio/mpeg"/>

  8. A GUID means "Globally Unique Identifier". By giving your item a "barcode" you can allow the aggregator to determine if it has to be updated or not. You can tell it if the link is permanent or not called a "PermaLink" (which is familiar to Bloggers).
    <guid isPermaLink="true">http://www.randypandy.com/perfumes/heavenscent.html</guid>

  9. Okay I expect you to know pubdate already!
    <pubDate>Sat, 10 Dec 2005 23:00:00 GMT</pubDate>

  10. The source command requires a URL and is used to give credit to the source of the article. This is used mostly when publishing to a Blog from somewhere else so the URL of the source is saved. So when we publish to RandyPandy.com all this information on his perfume it would read:
    <source url="http://www.yaddayadda/hs.xml">Secret Source of Heaven Scent Publicity</source>


Now don't go get confused. The only serious commands here are description and enclosure. And yes we will get a bit into "description" in our next article, and round out missing information on "enclosure" as well.


Okay lets see what are rss.xml file which will make our RSS feed looks like until now. (Due to the demands of the editing software used some of the commands appear as if on two lines. This is fine. When you create your template in the end just remember that everything between the first < and the last > is one command!)


Cobwebs Of The Mind - Source Code


<channel>



<title>Randy Pandy's Perfumery</title>
<description>RSS Feed for The Great Perfume Products Sold At Randy's Pandy's Perfumery</description>
<copyright>"Copyright 2006 Randy Pandy's Perfumery - All Rights Reserved"</copyright>
<link>http://www.randypandy.com</link>
<language>en-us</language>
<managingEditor>randypandy@randypandy.com (Randy Pandy)</managingEditor>
<webMaster>webmaster@randypandy.com (Pandy Randy)</webMaster>
<category>Ecommerce</category>
<pubdate>Mon, 5 Dec 2005 23:00:00 GMT</pubdate>
<lastBuildDate>Sun, 4 Dec 2005 23:00:00 GMT</lastBuildDate>
<image>



<title>Randy Pandy's Perfumery</title>
<width>142</width><height>99</height>
<link>http://www.randpandy.com</link>
<url>http://www.randpandy.com/images/randylogo.jpg</url>



</image>
<item>



<title>Heaven Scent Perfume At 50% Discount</title>
<link>http://www.randypandy.com/perfumes/heavenscent.html</link>
<description>Heaven Scent Perfume the Smell your lover will die for. Created especially by Skunk Perfumes it is their newest
and best selling perfume on the market today.  Purchase a beautifully shaped skunk bottle with this incredible perfume and get a whopping 50% off! And if you purchase over $100 we will throw in Free overnight delivery as well!</description>

<author>sandy@randypandy.com (Sandy Pandy - The Queen of Scent)</author>
<category>Perfume</category>
<category>On-Line Shopping</category>
<comments>http://www.randypandy.com/comments/skunkheaven.html</comments>
<enclosure url="http://www.randypandy.com/mp3s/heavenscentcomm.mp3" length="4368242" type="audio/mpeg"/>
<guid isPermaLink="true">http://www.randypandy.com/perfumes/heavenscent.html</guid>
<pubDate>Sat, 10 Dec 2005 23:00:00 GMT</pubDate>
<source url="http://www.yaddayadda/hs.xml">Secret Source Publicity</source>



</item>



</channel>
Cobwebs Of The Mind - Source Code
There you have the basics of Channel.
Our next article will discuss the innards of "description" & "enclosure".




Previous Articles In This Series:



  1. The Basics of Blogging and Web Site Creation - Part One: Content Is King

  2. The Basics of Blogging and Web Site Creation - Part Two: Introduction To Keywords

  3. Part Three - Keywords, Tags, Categories - Oh Vey! I Am So Mixed Up!

  4. Blogging & Website Basics - Part Four: So How The Hell Do I Get Bonafide Links To My Blog?

  5. Blogging - Part Five: Trying to Understand the Psychology Behind It All

  6. Blogging - Part Six: Viral Technology - An Introduction

  7. Blogging - Part Seven: Article Submission As A Tool To Extend Your Reach

  8. Basics Of Blogging Series - Part Eight: Using Email As An Advertising Tool

  9. Basics of Blogging Series: Part Nine - RSS Mania Addiction An Introduction To RSS and the Terminology

  10. Basics of Blogging Series: Part Ten - Outline of How to Create an RSS Feed

  11. Basics of Blogging Series: Part Eleven - Debunking a Few RSS Myths

  12. Basics of Blogging Series: Part Twelve - The RSS Feed Template File

  13. Basics of Blogging Series: Part Thirteen - The Basic Elements in the "Channel" Element

  14. Basics of Blogging Series: Part 14 - How the RSS Feed Works & Some Programming Constructs

  15. Basics of Blogging - Part 15 - Editor Tools - Qumana & Performancing Extension for Firefox

  16. Basics of Blogging - Part 15A - Qumana's Drop Pad

  17. Basics of Blogging Series: Part 16 - RSS Channel Sub-Elements Specifically "Image" (& How To Use It)


Click Here For The Cumulative Index To All Posts @ Cobwebs Of The Mind


Tags: , , , , , , , , , , , , ,
Categories: technology, internet, Basics of Blogging Series, What Is RSS? Series
Basics of Blogging Series: Part 17 - RSS - The Elements Within the "Item" Element


Edited With Qumana


No comments: