MAGPIE RSS experts HELP PLEASE!

Discussion in 'XML & RSS' started by chrisnyce, Apr 1, 2010.

  1. #1
    Hi All,

    I'm using Magpie to bring in RSS feeds and I need to control how many items it's pulling in to avoid breaking the look and feel of my website.

    Can someone help me with the php code to control the number of items. My knowledge of PHP is quite basic so I would also need to know the code and the file that I should insert the code in to. Someone who is familiar with Magpie could be a lifesaver here.

    Thanks.
     
    chrisnyce, Apr 1, 2010 IP
  2. canadianguy_001

    canadianguy_001 Peon

    Messages:
    97
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    they go over this in the magpie cookbook

    $num_items = 10; // limit to 10 items
    $rss = fetch_rss($url); // fetch the feed

    $items = array_slice($rss->items, 0, $num_items); //we use array_slice to shorten our array of the rss items we just fetched

    foreach ( $items as $item ) {

    //cycle through all the array items as per usual

    }
     
    canadianguy_001, Apr 2, 2010 IP