Developing Feeds with RSS and Atom by Ben Hammersley
Total Page:16
File Type:pdf, Size:1020Kb
Developing Feeds with RSS and Atom By Ben Hammersley ............................................... Publisher: O'Reilly Pub Date: April 2005 ISBN: 0-596-00881-3 Pages: 272 Table of Contents | Index | Errata Perhaps the most explosive technological trend over the past two years has been blogging. As a matter of fact, it's been reported that the number of blogs during that time has grown from 100,000 to 4.8 million-with no end to this growth in sight. What's the technology that makes blogging tick? The answer is RSS--a format that allows bloggers to offer XML-based feeds of their content. It's also the same technology that's incorporated into the websites of media outlets so they can offer material (headlines, links, articles, etc.) syndicated by other sites. As the main technology behind this rapidly growing field of content syndication, RSS is constantly evolving to keep pace with worldwide demand. That's where Developing Feeds with RSS and Atom steps in. It provides bloggers, web developers, and programmers with a thorough explanation of syndication in general and the most popular technologies used to develop feeds. This book not only highlights all the new features of RSS 2.0-the most recent RSS specification-but also offers complete coverage of its close second in the XML-feed arena, Atom. The book has been exhaustively revised to explain: metadata interpretation the different forms of content syndication the increasing use of web services how to use popular RSS news aggregators on the market After an introduction that examines Internet content syndication in general (its purpose, limitations, and traditions), this step-by-step guide tackles various RSS and Atom vocabularies, as well as techniques for applying syndication to problems beyond news feeds. Most importantly, it gives you a firm handle on how to create your own feeds, and consume or combine other feeds. If you're interested in producing your own content feed, Developing Feeds with RSS and Atom is the one book you'll want in hand. Developing Feeds with RSS and Atom By Ben Hammersley ............................................... Publisher: O'Reilly Pub Date: April 2005 ISBN: 0-596-00881-3 Pages: 272 Table of Contents | Index Copyright Preface Audience Assumptions This Book Makes How This Book Is Organized Conventions Used in This Book Using Code Examples Safari Enabled Comments and Questions Acknowledgments Chapter 1. Introduction Section 1.1. What Are RSS and Atom for? Section 1.2. A Short History of RSS and Atom Section 1.3. Why Syndicate Your Content? Section 1.4. Legal Implications Chapter 2. Using Feeds Section 2.1. Web-Based Applications Section 2.2. Desktop Applications Section 2.3. Other Cunning Techniques Section 2.4. Finding Feeds to Read Chapter 3. Feeds Without Programming Section 3.1. From Email Section 3.2. From a Search Engine Section 3.3. From Online Stores Chapter 4. RSS 2.0 Section 4.1. Bringing Things Up to Date Section 4.2. The Basic Structure Section 4.3. Producing RSS 2.0 with Blogging Tools Section 4.4. Introducing Modules Section 4.5. Creating RSS 2.0 Feeds Chapter 5. RSS 1.0 Section 5.1. Metadata in RSS 2.0 Section 5.2. Resource Description Framework Section 5.3. RDF in XML Section 5.4. Introducing RSS 1.0 Section 5.5. The Specification in Detail Section 5.6. Creating RSS 1.0 Feeds Chapter 6. RSS 1.0 Modules Section 6.1. Module Status Section 6.2. Support for Modules in Common Applications Section 6.3. Other RSS 1.0 Modules Chapter 7. The Atom Syndication Format Section 7.1. Introducing Atom Section 7.2. The Atom Entry Document in Detail Section 7.3. Producing Atom Feeds Chapter 8. Parsing and Using Feeds Section 8.1. Important Issues Section 8.2. JavaScript Display Parsers Section 8.3. Parsing for Programming Section 8.4. Using Regular Expressions Section 8.5. Using XSLT Section 8.6. Client-Side Inclusion Section 8.7. Server-Side Inclusion Chapter 9. Feeds in the Wild Section 9.1. Once You Have Created Your Simple RSS Feed Section 9.2. Publish and Subscribe Section 9.3. Rolling Your Own: LinkPimp PubSub Section 9.4. LinkpimpClient.pl Chapter 10. Unconventional Feeds Section 10.1. Apache Logfiles Section 10.2. Code TODOs to RSS Section 10.3. Daily Doonesbury Section 10.4. Amazon.com Wishlist to RSS Section 10.5. FedEx Parcel Tracker Section 10.6. Google to RSS with SOAP Section 10.7. Last-Modified Files Section 10.8. Installed Perl Modules Section 10.9. The W3C Validator to RSS Section 10.10. Game Statistics to Excel Section 10.11. Feeds by SMS Section 10.12. Podcasting Weather Forecasts Section 10.13. Having Amazon Produce Its Own RSS Feeds Section 10.14. Cross-Poster for Movable Type Chapter 11. Developing New Modules Section 11.1. Namespaces and Modules Within RSS 2.0 and Atom Section 11.2. Case Study: mod_Book Section 11.3. Extending Your Desktop Reader Section 11.4. Introducing AmphetaDesk Appendix A. The XML You Need for RSS Section A.1. What Is XML? Section A.2. Anatomy of an XML Document Section A.3. Tools for Processing XML Appendix B. Useful Sites and Software Section B.1. Uber Resources Section B.2. Specification Documents Section B.3. Mailing Lists Section B.4. Validators Section B.5. Desktop Readers Colophon Index Copyright © 2005 O'Reilly Media, Inc. All rights reserved. Printed in the United States of America. Published by O'Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O'Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 [email protected] . Nutshell Handbook, the Nutshell Handbook logo, and the O'Reilly logo are registered trademarks of O'Reilly Media, Inc. Developing Feeds with RSS and Atom, the image of an American kestrel, and related trade dress are trademarks of O'Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O'Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and authors assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein. Preface This book is about RSS and Atom, the two most popular content-syndication technologies. From distributing the latest web site content to your desktop and powering loosely coupled applications on the Internet, to providing the building blocks of the Semantic Web, these two technologies are among the Internet's fastest growing. There are millions of RSS and Atom feeds available across the Web today; this book shows you how to read them, how to create your own, and how to build applications that use them. It covers: RSS 2.0 and its predecessors RSS 1.0 and the Semantic Web Atom and the latest generation of feed technology How to create and parse feeds Extending RSS and Atom through modules Using RSS and Atom on the desktop, on the Web, and in the enterprise Building RSS- and Atom-based applications Audience This book was written with two somewhat interrelated groups in mind: Web developers and web site authors This book should be read by all web developers who want to share their site with others by offering feeds of their content. This group includes everyone from webloggers and amateur journalists to those running large-budget, multiuser sites. Whether you're working on projects for multinational news organizations or neighborhood sports groups, with RSS and Atom, you can extend the reach, power, and utility of your product, and make your life easier and your work more productive. This book shows you how. Developers This book is also for developers who want to use the content other people are syndicating and build applications that produce feeds as their output. This group includes everyone from fan- site developers wanting the latest gaming news and intranet builders needing up-to-date financial information on the corporate Web, to developers looking to incorporate news feeds into artificially intelligent systems or build data-sharing applications across platforms. For you, this book delves into the interpretation of metadata, different forms of content syndication, and the increasing use of web services technology in this field. We'll also look at how you can extend the different flavors of RSS and Atom to fit your needs. Depending on your interests, you may find some chapters more necessary than others. Don't be afraid to skip around or look through the index. There are all kinds of ways to use RSS and Atom. Assumptions This Book Makes The technology used in this book is not all that hard to understand, and the concepts specific to RSS and Atom are fully explained. The book assumes some familiarity with HTML and, specifically, XML and its processing techniques, although you will be reminded of important technical points and given places to look for further information. (Appendix A provides a brief introduction to XML if you need one.) Most of the code in this book is written in Perl, but the examples are commented sufficiently to make things clear and easily portable. There are also some examples in PHP and Ruby. However, users of any language will get a lot from this book: the explanations of the standards and the uses of RSS and Atom are language-agnostic.