Working With RSS In ColdFusion Presented by Pete Freitag Principal Consultant, Foundeo Inc.
June 27 th - 30 th 2007www.cfunited.com 2 What’s RSS? Really Simple Syndication An XML Publishing Format
June 27 th - 30 th 2007www.cfunited.com 3 That Orange Button The Standard Feed Button The Orange RSS Button Circa 2003
June 27 th - 30 th 2007www.cfunited.com 4 RSS Adoption Source: Yahoo,
June 27 th - 30 th 2007www.cfunited.com 5 An XML Document One File (called a channel) can have multiple articles (called items) Each Item Can Have Title Link Description Date And More
June 27 th - 30 th 2007www.cfunited.com 6 Why Publish RSS? Increase Traffic More Recurring Visitors Convenient for your Readers
June 27 th - 30 th 2007www.cfunited.com 7 Downsides of RSS? Content Theft Copyright Infringement RSS makes it easier to steal your content. Bandwidth
June 27 th - 30 th 2007www.cfunited.com 8 How is RSS Used? RSS Readers (Standalone, Web Based, or Built in to Browser) Aggregators (Such as MXNA, and Fullasagoog) RSS to
June 27 th - 30 th 2007www.cfunited.com 9 Not Just for Blogs News / PR Forums Newsletters
June 27 th - 30 th 2007www.cfunited.com 10 The Feed Format War RSS vs. ATOM RSS 2.0 is simple and gets the job done ATOM is more complex with some additional features.
June 27 th - 30 th 2007www.cfunited.com 11 Show me the code table news ( id integer, title varchar(100), story text, date_published datetime )
June 27 th - 30 th 2007www.cfunited.com 12 Getting Started XML Declaration. Must be on first line of the file Reset the output buffer
June 27 th - 30 th 2007www.cfunited.com 13 Set the Content Type text/xml - generic xml content type application/rss+xml - content type for rss feeds
June 27 th - 30 th 2007www.cfunited.com 14 Start the RSS Feed...
June 27 th - 30 th 2007www.cfunited.com 15 RSS Channel Metadata Feed Name About It. en-us Wed, 28 Jun :37:00 GMT
June 27 th - 30 th 2007www.cfunited.com 16 Dates In RSS Feeds Dates must comply with RFC 822 Same format used by HTTP Use the GetHttpTimeString() function.
June 27 th - 30 th 2007www.cfunited.com 17 RSS Feed Items
June 27 th - 30 th 2007www.cfunited.com 18 RSS Feed Item Article Title Content of the Article Here Mon, 12 Sep :37:00 GMT
June 27 th - 30 th 2007www.cfunited.com 19 XML Safety Use the XMLFormat() Function to escape special characters. Wrap HTML with a CDATA Section.
June 27 th - 30 th 2007www.cfunited.com 20 Validate Your Feed feedvalidator.org
June 27 th - 30 th 2007www.cfunited.com 21 Podcasting / Enclosures Put an tag inside an Length is in bytes
June 27 th - 30 th 2007www.cfunited.com 22 CategoriesCategories Categories are used as keywords or “tags” for RSS consumers. Added as child tags of an ColdFusion RSS
June 27 th - 30 th 2007www.cfunited.com 23 More Item Level Tags TagDescription The address of the author. Used to cite the source of the article.
June 27 th - 30 th 2007www.cfunited.com 24 More Channel Metadata Tags Tag NameDescription Copyright notice Number of minutes to cache the feed. Include an image for the RSS feed. Listing of days that the feed will not change. Lists hours where the feed is not changed. See the RSS 2.0 Spec for more details:
Thanks. Questions?