Jump to content

slider2015

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

slider2015's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am desperatly seeking some help. I want to build a page that pulls in feeds from 3 different sites, but i would like them to be filtered by some keywords. I'm not entirely sure about the best way to do this. If there's any one who knows about Magpie, and how to incorporate this feature, that would be great. Curretnly in my magpie rss fetch script I have: $keywords = array ("keyword1","keyword2","keyword3") function has_keyword($haystack, $wordlist) { $found = false; foreach ($wordlist as $w) { if (stripos($w, $haystack) !== 0) { $found = true; } } return $found; } $rss = simplexml_load_file("http://www.mywebsite.com/my/rss/feed/"); foreach ($rss->channel->item as $i) { if ( has_keywords($i->title, $keywords) || has_keywords($i->description, $keywords) || has_keywords($i->category) ) { $news[] = array ( "title" => $i->title, "description" => $i->description, "link" => $i->link ); } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.