11.07.2015 Views

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

PHP MySQL - Stilson.net

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 20 • WEB SERVICESwww.it-ebooks.infoIntroducing SimplePieSimplePie (www.simplepie.org) is a powerful RSS parser which makes aggregating and publishing RSSfeeds, well, simple. Released under the open source BSD license, offering support for all of the majorversions of RSS (including the popular alternative to RSS known as Atom), capable of detecting mediaand iTunes RSS elements, and actively maintained even six years after the initial release, SimplePieappears to be the best of many solutions available to the <strong>PHP</strong> community. In this section, I’ll show youhow to use SimplePie to incorporate RSS feeds into your website.Installing SimplePieSimplePie is self-contained within a single class library, meaning you’ll be able to use it simply byreferencing the library within your script using a require_once() statement. However, SimplePie doesboth require and recommend that several key <strong>PHP</strong> extensions are configured and enabled, includingcURL, iconv, mbstring, PCRE, XML, and Zlib. You could use <strong>PHP</strong>’s phpinfo() function to determinewhether these extensions are enabled; however, the SimplePie download offers a useful script thatperforms the compatibility check for you. So head over to SimplePie’s download page athttp://github.com/simplepie/simplepie to get the latest stable version.Once downloaded, uncompress the archive and place it within your web server’s document root,renaming the directory to something which belies its contents, such as simplepie. Once in place,navigate to the script named sp_compatibility_test.php, which resides inside the compatibility_testdirectory. You should be greeted with output which looks quite similar to the screenshot presented inFigure 20-2.Figure 20-2. Using SimplePie’s Compatibility Test416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!