Chapter 4. Creating RSS Feeds from Scratch


There are plenty of RSS editors that let you create an RSS feed and upload it to a Web site. But as you get more sophisticated with handling RSS, there will be times you'll want to do the work yourself. You may need to do some things your editor can't do, for example, or you might just want to set up a template for your RSS feed and periodically edit the items yourself.

Working with RSS directly gives you all the power this rich set of languages has to offer. But now the question is, which version of RSS do you want to use?

To make sure you know how to work with a particular version of RSS, you have to read the specification for that version. The specification tells you how to write the actual XML for that version of RSS. You can find the specifications for the various RSS versions and Atom at the following sites:

  • RSS 0.90 www.purplepages.ie/RSS/netscape/rss0.90.html

  • RSS 0.91 http://backend.userland.com/rss091 and also see http://my.netscape.com/publish/formats/rss-spec-0.91.html

  • RSS 0.92 http://backend.userland.com/rss092

  • RSS 0.93 http://backend.userland.com/rss093

  • RSS 1.0 http://web.resource.org/rss/1.0/spec

  • RSS 1.1 http://inamidst.com/rss1.1/

  • RSS 2.0 http://blogs.law.harvard.edu/tech/rss

  • Atom http://xml.coverpages.org/draft-ietf-atompub-format-11.txt

I can't include all the specifications in this chapter, but I'll cover the version that started the whole RSS explosionversion 0.91, still in widespread use. I will also include RSS 2.0, the most popular version and by far the one in most common use today.

What about RSS version 1.0? Although in common use as well, RSS 1.0 is a different language and not a part of the original RSS tree. Based mainly on Resource Description Framework (RDF), RSS 1.0 is a departure from the rest of the RSS versions. (RSS 2.0 is more a descendent of RSS 0.91 than RSS 1.0 is.) I'm going to give an overview of RSS 1.0; if you want more details, take a look at the RSS 1.0 specification at the URL listed earlier. (Also see Chapter 1, "Gotta Get My RSS," for a brief history of RSS.)

I will also touch on Atom. It differs from the RSS specifications mainly because it was developed by a true standards body, the Internet Engineering Task Force (IETF). However, Atom is a complex language and has yet to be widely adopted. A Web survey shows that Atom is still in relatively small use compared with RSS.

My feeling is that while there will always be a place for Atom, it's too complex for the majority of RSS writers. Few have the patience or time to work through a 50-plus-page formal specification before starting to write. The charm of RSS has always been that it's easy to work with, and Atom's complex specifications have a much tougher time winning converts. People had the same problems when the World Wide Web Consortium (W3C) introduced XHTML (Extensible Hypertext Markup Language) as the successor to HTML, and XHTML was so complex that it never took off. Atom might still take off, of course, and certainly if you use RSS editors that write Atom files the whole process becomes easy. Atom has quite a way to go, but it's an important specification, so an overview of Atom will be given in this chapter.

RSS and Atom are XML-based languages, and RSS and Atom files are really XML files. To write RSS and Atom from scratch, then, you have to know some of the rules of XML, and that's where we beginwith an XML primer.



Secrets of RSS
Secrets of RSS
ISBN: 0321426223
EAN: 2147483647
Year: 2004
Pages: 110

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net