Posted By

fritz on 02/01/08


Tagged

php rss feed magpie


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

JimiJay
iTony
SpinZ


RSS Code with Magpie RSS Feeder


 / Published in: PHP
 

need the magpie code

  1. <?
  2. $url = 'http://www.weatheroffice.gc.ca/rss/city/on-7_e.xml';
  3. $num_items = 1;
  4. //$rss = fetch_rss( $url );
  5. $rss = fetch_rss($url);
  6. $items = array_slice($rss->items, 0, $num_items);
  7.  
  8.  
  9.  
  10. echo "Channel Title: " . $rss->channel['title'] . "<p>";
  11. echo "<ul>";
  12. foreach ($rss->items as $item) {
  13. $href = $item['link'];
  14. $title = $item['title'];
  15. echo "<li><a href=$href>$title</a></li>";
  16. }
  17. echo "</ul>";
  18. ?>

Report this snippet  

You need to login to post a comment.