Nice RSS Aggregator/Parser


/ Published in: PHP
Save to your folder(s)

This parses RSS feeds very nicely using the DOM.


Copy this code and paste it in your HTML
  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. ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.