I notice this doesn’t quite work on words that have apostrophes. Say someone’s name is in the RSS feed like this … “George Bush’s agenda is to” … and someone searches for “Bush” … It’s not a match. How easy is it to implement “partial matches” in this class?
Hi
Sorry, i tried putting in two feeds seperated by commas, but it did not work? I tried using a feed with pictures (feed://feeds.revver.com/2.0/mrss/flash/search/nokia) in the the feed items, this did not work either?
Thanks
You can get images if you remove the strip_tags function from the content:
// $content = strip_tags($item->get_content());
$content = $item->get_content();
The demo strips away the tags, and hence the image data theimg tags contain.
This will work with both AND and OR. The term held in $matches[0] is an exact match to what is found in $text, so therefore case is preserved. Otherwise you could simp;ly use str_ireplace, without the preg_match. But then the value in $w would be substituted for the match and since all match terms are set to lower case, a lower case valu would be subsittued for the word in the text.
Where (what directory) should the add-on be placed in?
All is working fine with SimpliePie on my local server, just not the addon?
Any idea what I’m doing wrong?
I think I’m missing something. If I leave digg and type obama & economy, I don’t get anything.
I tried cnn.com, too (simplepie’s autodiscovery still works?) and didn’t get any hits. I think there must be some results for that search.
I also tried using this form to populate the simplepie filter add-on demo but no go.
What should I use as the form action? I was trying to use action=”simplepie_filter.php”. Again, this seems fantastic. Just wish I could figure out how to use it.
hi trying to get your script running and came up with this error
can you help please
Fatal error: Class simplepie_filter: Cannot inherit from undefined class simplepie in /var/www/html/rss/simplepie_filter.php on line 37
HI trying toget the script running and came kup with this error
Fatal error: Class simplepie_filter: Cannot inherit from undefined class simplepie in /var/www/html/rss/simplepie_filter.php on line 37
Thank you, just tried the demo and this works perfectly for me. OK this is probably a silly question and mainly because I’m a newbie but I can’t get the css styling working.
How do I style the title, date, content & images(padding) separately. I tried to add a classes to the echo lines but it either causes errors or nothing changes. So I’m asking if you could help guide me in the right direction.
Please help urgently.
I am busy with a new website that has to launch in a few days and I have based everything on simplepie.
Everything was going great until a tried to filter for a 2 letter word.
I also have an issue with searching for words that are contained within other words.
For example “ice” is found in “iceland”
How do you get results for “ice” only? Simplepie is space delimited so how do you filter for ” ice “?
Michael P. Shipley » SimplePie Filter on 16 May 2008 at 10:49 am #
[...] Demo [...]
Oliver on 04 Jul 2008 at 5:35 am #
Does this work with multiple feeds?
Michael Shipley on 04 Jul 2008 at 5:41 am #
Yes it does.
Matt on 29 Jul 2008 at 1:09 am #
Hi Michael,
I notice this doesn’t quite work on words that have apostrophes. Say someone’s name is in the RSS feed like this … “George Bush’s agenda is to” … and someone searches for “Bush” … It’s not a match. How easy is it to implement “partial matches” in this class?
Matt
Michael Shipley on 29 Jul 2008 at 2:34 am #
Matt,
Fixed. You can download the updated version here:
http://www.michaelpshipley.com/wordpress/wp-content/uploads/2008/07/simplepie_filter-2.zip
Matt on 29 Jul 2008 at 9:42 am #
Thanks for all of your efforts. This is a great tool.
Oliver on 22 Aug 2008 at 6:12 am #
Hi how do you put multiple feeds into this script? can it display pictures in the feed?
Thanks
Michael Shipley on 22 Aug 2008 at 8:48 am #
Oliver,
Yes it works with multiple feeds. Yes it will display pictures if they are contained in the feed items.
Oliver on 23 Aug 2008 at 12:17 pm #
Hi
Sorry, i tried putting in two feeds seperated by commas, but it did not work? I tried using a feed with pictures (feed://feeds.revver.com/2.0/mrss/flash/search/nokia) in the the feed items, this did not work either?
Thanks
Morten Hinrichs on 22 Oct 2008 at 1:46 pm #
Hi Michael
Is it possible to use the paging function (http://simplepie.org/wiki/tutorial/how_to_do_item_paging?s=paging) in this great tool
Thanks
Myron Turner on 25 Oct 2008 at 5:29 pm #
For Oliver–
You can get images if you remove the strip_tags function from the content:
// $content = strip_tags($item->get_content());
$content = $item->get_content();
The demo strips away the tags, and hence the image data theimg tags contain.
Myron Turner on 29 Oct 2008 at 6:06 pm #
Your highlight function in the demo script doesn’t always handle correctly situations in which there are two highlighted words in a line.
I get, for instance:
Source: Time Out – London Art Critic’s Choice
Andy “color:black;background-color:yellow”>Warhol: Other Voices, Other Rooms
where both Warhol and Rooms are supposed to be highlighted. Notice that the opening span tag is corrupt. I’ve changed my own script as follows:
function highlight($wordsToHighlight,$text)
{
$w = addslashes($wordsToHighlight);
$w = explode(’ ‘,$w);
foreach($w as $word)
{
if(preg_match(”/$word/i”, $text, $matches)) {
$text = str_replace ($matches[0],
”
. $matches[0] . ”, $text);
}
}
return $text;
This will work with both AND and OR. The term held in $matches[0] is an exact match to what is found in $text, so therefore case is preserved. Otherwise you could simp;ly use str_ireplace, without the preg_match. But then the value in $w would be substituted for the match and since all match terms are set to lower case, a lower case valu would be subsittued for the word in the text.
Mike Reynolds on 21 Dec 2008 at 11:31 pm #
Brilliant, I had been using Yahoo Pipes for this. Will look into your code to see if I can extend this for “filtering out” posts with specific words.
Tony Reyes on 03 Feb 2009 at 2:07 pm #
I have one question, how did you do the search method that you have here as an example. I would like to implement that as well.
thanks
CC on 11 Feb 2009 at 3:05 pm #
Where (what directory) should the add-on be placed in?
All is working fine with SimpliePie on my local server, just not the addon?
Any idea what I’m doing wrong?
Chris on 01 Mar 2009 at 7:51 pm #
I think I’m missing something. If I leave digg and type obama & economy, I don’t get anything.
I tried cnn.com, too (simplepie’s autodiscovery still works?) and didn’t get any hits. I think there must be some results for that search.
I also tried using this form to populate the simplepie filter add-on demo but no go.
What should I use as the form action? I was trying to use action=”simplepie_filter.php”. Again, this seems fantastic. Just wish I could figure out how to use it.
belle on 31 May 2009 at 3:07 pm #
This tool is really great. I am going to build a website with it
tom on 10 Sep 2009 at 9:35 pm #
hi trying to get your script running and came up with this error
can you help please
Fatal error: Class simplepie_filter: Cannot inherit from undefined class simplepie in /var/www/html/rss/simplepie_filter.php on line 37
thanks in advance if you can/will help
tom on 10 Sep 2009 at 9:38 pm #
HI trying toget the script running and came kup with this error
Fatal error: Class simplepie_filter: Cannot inherit from undefined class simplepie in /var/www/html/rss/simplepie_filter.php on line 37
tom
Michael Shipley on 10 Sep 2009 at 9:56 pm #
tom:
you must include the simplepie class before including the simplepie_filter class.
Pete on 09 Jan 2010 at 8:53 am #
Hi Michael,
Thank you, just tried the demo and this works perfectly for me. OK this is probably a silly question and mainly because I’m a newbie but I can’t get the css styling working.
How do I style the title, date, content & images(padding) separately. I tried to add a classes to the echo lines but it either causes errors or nothing changes. So I’m asking if you could help guide me in the right direction.
Thanks again.
Pete on 09 Jan 2010 at 10:42 am #
Span style seems to work, image padding ?
John on 07 Mar 2010 at 8:56 am #
Please help urgently.
I am busy with a new website that has to launch in a few days and I have based everything on simplepie.
Everything was going great until a tried to filter for a 2 letter word.
For example: http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss.xml
Search for “in” or “at” and you will get no result even though it exists in the rss frequently.
I first thought it was my programming but then when I tested it on this website I got no result either.
Please can you help me to fix this.
John on 07 Mar 2010 at 9:11 am #
I also have an issue with searching for words that are contained within other words.
For example “ice” is found in “iceland”
How do you get results for “ice” only? Simplepie is space delimited so how do you filter for ” ice “?
Deyan Kalchev on 11 Mar 2010 at 6:16 am #
I try the demo, as I made rss feeds from sites in Cyrillic.
There was no finding and coloring of words. Can this be okay and how?