4 Pustaka RSS Parser untuk PHP

Terkadang kita memerlukan data dari RSS yang diambil dari website lain untuk mengolah ataupun mengintegrasikan data tersebut dengan proyek yang kita buat. Kita tentu bisa membuat RSS parser sendiri, tetapi sebelum menghabiskan waktu untuk membuatnya, kita lihat dulu pustaka-pustaka RSS parser yang telah ada.

SimplePie

SimplePie

SimplePie adalah RSS parser yang sangat cepat dan mudah digunakan.

Fitur :

  • 1 file, tidak ada instalasi.
  • Terdapat mekanisme cache.
  • Mempunyai plugin untuk WordPress, Joomla, Drupal dan lainnya.

Contoh penggunaan

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
    require 'simplepie/simplepie.inc'; 
    $feed = new SimplePie('http://feeds.feedburner.com/komunitaz');
?>
 
<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

Fitur

  • Mudah digunakan.
  • Parses RSS 0.9 – RSS 1.0
  • Cache yang terintegrasi.
  • HTTP Conditional GETs.
  • Dapat dikonfigurasi.
  • Modular.
  • Aman – mendukung HTTP authentication,dan SSL.
  • Penggunaan bandwidth yang rendah – mendukung transparent GZIP encoding untuk mengurangi penggunaan bandwidth.
  • Tidak menggunakan fopen(), tetap bekerja walau setting allow_url_fopen dimatikan.

Contoh penggunaan

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
    require('magpierss/rss_fetch.inc');
    $rss = fetch_rss('http://feeds.feedburner.com/komunitaz');        
?> 
 
<h1>Komunitaz</h1>
<ul>
<?php foreach ($rss->items as $item): ?>
    <li>
        <a href="<?= $item['link']; ?>"><?= $item['title']; ?></a>
    </li>
<?php endforeach; ?>
</ul>

RSS_PHP

RSS_PHP adalah RSS parser dan XML parser untuk PHP 5+.

Contoh penggunaan

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://feeds.feedburner.com/komunitaz');
    $items = $rss->getItems();        
?> 
 
<h1>Komunitaz</h1>
<ul>
<?php foreach ($items as $item): ?>
    <li>
        <a href="<?= $item['link']; ?>"><?= $item['title']; ?></a>
    </li>
<?php endforeach; ?>
</ul>

Last RSS

Last RSS mengklaim sebagai RSS parser yang sederhana tetapi powerful.

Contoh penggunaan

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://feeds.feedburner.com/komunitaz');
?> 
 
<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:

  1. Kumpulan Pustaka PHP
  2. flot Pustaka Javascript Plotting untuk jQuery
  3. Drizzle Database Server Untuk Web dan Cloud
  4. CakePHP : PHP Web Framework
  5. Python Untuk Programmer PHP

About Gilang Chandrasa

Gilang Chandrasa adalah seorang web developer yang sangat menyukai dunia open source. Memasak adalah salah satu hobinya diluar dunia IT. Pendiri Yumbaa dan Komunitaz ini juga adalah seorang blogger, menulis di berbagai situs termasuk komunitasweb. Mempunyai mimpi untuk memajukan dunia web Indonesia.
This entry was posted in Pustaka and tagged , . Bookmark the permalink.

1 Tweet

4 Responses to 4 Pustaka RSS Parser untuk PHP

  1. oh iya…

    diantara banyak script php rss parse yang bersifat open source , yang paling banter buat nge-parsingnya apa yach??

    simplepie itu agak lemot menurut saya.. magpie biasa2 ajah :D

  2. Mas, ada gak ya yang bisa get semua full satu postingan jadi ga cuma deskripsi yg termuat di RSS aja.

    dimana ya saya bisa dapat php class nya?

    trims

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Additional comments powered by BackType