Sometimes you need to parse RSS from other website and integrate to your project. Well you can create your own library to parse that RSS, but before wasting your development time, please take a look these great libraries for parsing RSS.
SimplePie

SimplePie is a very fast and easy-to-use PHP class to parse RSS.
Features :
- Single file, no install.
- Cache mechanism.
- Has plugin for such as WordPress, Joomla, Drupal and others.
Usage Example
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php require 'simplepie/simplepie.inc'; $feed = new SimplePie('http://feeds2.feedburner.com/Komunitasweb'); ?> <h1><?php print $feed->get_title(); ?></h1> <ul> <?php foreach ($feed->get_items(0, 10) as $item): ?> <li> <a href="<?= $item->get_permalink(); ?>"><?= $item->get_title(); ?></a> </li> <?php endforeach; ?> </ul> |
MagpieRSS
Features
- Easy to Use.
- Parses RSS 0.9 – RSS 1.0
- Integrated Object Cache.
- HTTP Conditional GETs.
- Configurable.
- Modular.
- Secure – supports HTTP authentication, and SSL.
- Bandwidth friendly – supports transparent GZIP encoding to reduce bandwidth usage.
- Does not use fopen(), work even if allow_url_fopen is disabled.
Usage Example
1 2 3 4 5 6 7 8 9 10 11 12 13 | <?php require('magpierss/rss_fetch.inc'); $rss = fetch_rss('http://feeds2.feedburner.com/Komunitasweb'); ?> <h1>KomunitasWeb</h1> <ul> <?php foreach ($rss->items as $item): ?> <li> <a href="<?= $item['link']; ?>"><?= $item['title']; ?></a> </li> <?php endforeach; ?> </ul> |
RSS_PHP
RSS_PHP is a RSS Parser and XML Parser for PHP 5+.
Usage Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | <?php require 'rss_php/rss_php.php'; $rss = new rss_php; $rss->load('http://feeds2.feedburner.com/Komunitasweb'); $items = $rss->getItems(); ?> <h1>KomunitasWeb</h1> <ul> <?php foreach ($items as $item): ?> <li> <a href="<?= $item['link']; ?>"><?= $item['title']; ?></a> </li> <?php endforeach; ?> </ul> |
Last RSS
Last RSS claim to be simple yet powerful PHP RSS parser.
Usage Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | <?php require('lastRSS/lastRSS.php'); $rss = new lastRSS; $feed = $rss->get('http://feeds2.feedburner.com/Komunitasweb'); ?> <h1><?= $feed['title'] ?></h1> <ul> <?php foreach ($feed['items'] as $item): ?> <li> <a href="<?= $item['link']; ?>"><?= $item['title']; ?></a> </li> <?php endforeach; ?> </ul> |
Related posts:
- 20 Great PHP Libraries You Need to Know
- Ultimate Collection of PHP Libraries
- CodeIgniter Tutorials to Help You Get Started
- Using Django template in PHP
- Showing the weather with PHP and Google Weather API
August 31st, 2009 | Comments Off
