[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[syndication] Re: RSS feed filtered by keywords?



>> Hey does anyone know of an RSS reader that supports filtering feeds by
>
>I was just thinking of this recently. It seems like something that could
>easily be hacked into Blagg or AmphetaDesk... Of course I haven't done
>anything more than think about it yet...

Indeed. I've mentioned it a few times on the AmphetaDesk mailing lists.
Ultimately, for example, if you wanted to show all items that ONLY matched
"perl", you could hop into amphetadesk/templates/default/index.html and add:

   next unless $item->{description} =~ /perl/;

after these lines:

 # each of the channel items.
 foreach my $item (@{$data->{item}}) {

Likewise, you could still show all the items, but instead, hilight items in
red when they match your criteria (remove the "next unless" line from above
first). Change this line:

 to_browser(qq{ $item->{description} }) if $item->{description};

to:

 to_browser(qq{ <font color="#ffff00"> }) if $item->{description} =~ /perl/;
 to_browser(qq{ $item->{description} }) if $item->{description};
 to_browser(qq{ </font> }) if $item->{description} =~ /perl/;

-- 
Morbus Iff ( sleep breeds sanity )
Culture: http://www.disobey.com/ and http://www.gamegrene.com/
Tech: http://www.oreillynet.com/pub/au/779 - articles and weblog
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus