// Include the SimplePie library require_once('php/simplepie.inc'); // Because we're using multiple feeds, let's just set the headers here. header('Content-type:text/html; charset=utf-8'); // These are the feeds we want to use $feeds = array( 'http://www.buccaneers.com/rss/bmn.xml', 'http://sports.yahoo.com/nfl/teams/tam/rss.xml', 'http://bestbucsblog.blogspot.com/atom.xml', 'http://tampabay.typepad.com/bucs/index.rdf', 'http://bucpress.com/index.php/feed/', 'http://buccaneers.realfootball365.com/rss.xml' ); // This array will hold the items we'll be grabbing. $first_items = array(); // Let's go through the array, feed by feed, and store the items we want. foreach ($feeds as $url) { // Use the long syntax $feed = new SimplePie(); $feed->set_feed_url($url); $feed->init(); // How many items per feed should we try to grab? $items_per_feed = 5; // As long as we're not trying to grab more items than the feed has, go through them one by one and add them to the array. for ($x = 0; $x < $feed->get_item_quantity($items_per_feed); $x++) { $first_items[] = $feed->get_item($x); } // We're done with this feed, so let's release some memory. unset($feed); } // We need to sort the items by date with a user-defined sorting function. Since usort() won't accept "SimplePie::sort_items", we need to wrap it in a new function. function sort_items($a, $b) { return SimplePie::sort_items($a, $b); } // Now we can sort $first_items with our custom sorting function. usort($first_items, "sort_items"); // Begin the (X)HTML page. ?>
Talk Buc Smac HereLinksBuccaneers.comNFL.com |
The Latest Tampa Bay Buccaneers NewsWarning: Invalid argument supplied for foreach() in /home/drismail/drismail.com/bucs/index.php on line 128 |