Hi, first thanks for your great work =)

I found a little bug in the keyword filter: a feed item is kept only if it matches a positive keyword. This means that if you only specified a negative keyword, it will not be kept...
Here is my suggestion of patch for feedapi_keyword_filter.module (lines 98+):

          // Get through each feed item.
          foreach ($feed->items as $key=>$item) {

            // If negative keyword has been found then move directly to next item.
            foreach ($worldlist['neg'] as $value) {
              // Number 2 here means that we are stepping out from both foreach statement.
              if (stristr($item->description, $value)) continue 2;
            }

            // And now we process positive keywords.
            $keepitem = false;
            // If no positive keyword to match
            if (count($worldlist['pos']) == 0) {
                $keepitem = true;
            } else {
                foreach ($worldlist['pos'] as $value) {
                  if (stristr($item->description, $value)) {
                    // If keyword found then the item is worth saving.
                    // And there is no reason to try out remaining keywords --> move to the next item.
                    $keepitem = true;
                    continue;
                  }
                }
            }
            
            // Keep the item if a positive keyword was matched or no positive keyword to match
            if ($keepitem) {
                $newfeed[] = $feed->items[$key];
            }
            
          } // end of items parsing

Regards,
Julien Nicoulaud
This is still no perfect to me, because

Comments

Ek0’s picture

Version: 6.x-2.x-dev » 6.x-1.1
Poznii’s picture

Version: 6.x-1.1 » 5.x-0.1

Hi, Ek0!

Many thanks for patch.