Latest Hurricanes News
// load SimplePie Class
require_once 'wp-content/plugins/simplepie-core/simplepie.inc';
// extend SimplePie class and instantiate
require_once 'wp-content/plugins/simplepie-plugin-for-wordpress/processing/simplepie_filter.php';
$feed = new SimplePie_Filter();
// turn off caching since this is just a demo
$feed->enable_cache(false);
// these are the test feeds (clinton, obama)
$urls = array
(
‘http://cluster.leaguestat.com/rss/feed.php?client_code=whl&feed=news’,
‘http://blogsearch.google.com/blogsearch_feeds?hl=en&q=lethbridge+hurricanes&ie=utf-8&output=rss’
);
$feed->set_feed_url($urls);
// set words to filter by
$words = ‘Lethbridge Hurricanes’;
// set filter mode (and/or)
$mode = ‘or’;
// set the filter words and mode
$feed->set_filter($words,$mode);
// go speed racer
$feed->init();
if($feed->error())
{
echo ‘
‘,$feed->error(),’
‘;
die;
}
else
{
$items = $feed->get_items(0,20);
$itemsFiltered = $feed->filter($items);
echo ‘
Search Results
‘;
if(!count($itemsFiltered))
{
echo ‘
‘ , $words , ‘ not found
‘;
}
else
{
foreach($itemsFiltered as $item)
{
echo ‘



Leave a Reply