Home arrow PHP arrow Page 4 - Web Services

RSS Syntax - PHP

This five-part article series will introduce you to Web Services. If you've ever wanted to incorporate them into your web sites, this is a good place to start. This article is excerpted from chapter 20 of the book Beginning PHP and Oracle: From Novice to Professional, written by W. Jason Gilmore and Bob Bryla (Apress; ISBN: 1590597702).

  1. Web Services
  2. Why Web Services?
  3. Real Simple Syndication
  4. RSS Syntax
By: Apress Publishing
Rating: starstarstarstarstar / 1
July 22, 2010

print this article



If youíre not familiar with the general syntax of an RSS feed, Listing 20-1 offers an example that will be used as input for the scripts that follow. Although a discussion of RSS syntax specifics is beyond the scope of this book, youíll nonetheless find the structure and tags to be quite intuitive (after all, thatís why they call it Real Simple Syndication).

Listing 20-1. A Sample RSS Feed (blog.xml)

<?xml version="1.0" encoding="iso-8859-1"?>
   <rss version="2.0">
<title>Inside Open Source</title> 
      <link>http://opensource.apress.com/ </link>

      <title>Killer Firefox Tip #294</title>
      <link>http://opensource.apress.com/ article/190/</link>
      <author>W. Jason Gilmore</author>
      <description>Like most of you, I spend bunches of time downloading large
files from the Web, typically podcasts and PDF documents...</description>

      <title>Beginning Ubuntu Linux wins Linux Journal Award!</title> 
      <link>http://opensource.apress.com/ article/189/</link>
      <author>Keir Thomas</author>
      <description>Woo hoo! My book, Beginning Ubuntu Linux, has won an award
          in the Linux Journal Editor's Choice 2006 awards!
          More precisely...</description>

      <title>Forms Validation with CakePHP</title>
      <link>http://opensource.apress.com/ article/188/</link>
      <author>W. Jason Gilmore</author>
      <description>Neglecting to validate user input is akin to foregoing
          any defensive
          gameplan for containing the NFL's leading rusher. Chances are
          sooner or later...</description>

This example doesnít take advantage of all available RSS elements. For instance, other feeds might contain elements describing the feedís update interval, language, and creator. However, for the purposes of the examples found in this chapter, it makes sense to remove those components that have little bearing on instruction.

Now that youíre a bit more familiar with the purpose and advantages of RSS, youíll next learn how to use PHP to incorporate RSS into your own development strategy. Although there are numerous RSS tools written for the PHP language, one in particular offers an amazingly effective solution for retrieving, parsing, and displaying feeds: MagpieRSS.

Please check back next week for the continuation of this article.

>>> More PHP Articles          >>> More By Apress Publishing

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: