Posted By

Unreal on 02/28/09


Tagged

rss nice AggregatorParser


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

Bluewall
vali29
BrianCoyDesign
techdetours


Nice RSS Aggregator/Parser


 / Published in: PHP
 

URL: http://www.imben.co.uk

This parses RSS feeds very nicely using the DOM.

  1. <?php
  2. $links = array('feed1', 'feed2', 'feed3');
  3.  
  4. foreach($links as $link){
  5.  
  6. $doc = new DOMDocument();
  7. $doc->load($link);
  8.  
  9. $dataset = $doc->getElementsByTagName( "item" );
  10. foreach( $dataset as $row )
  11. {
  12.  
  13. $feeds = $row->getElementsByTagName( "link" );
  14. $feed = $feeds->item(0)->nodeValue;
  15.  
  16. echo $feed.'<br />';
  17. }
  18. }
  19. ?>

Report this snippet  

You need to login to post a comment.