views:

40

answers:

1

Hello,

I am using yahoo pipes to get content matching a certian category from my WordPress.com Blog. Everything is working fine but WordPress adds "share" links to the bottom of the feed that I would like to remove.

Here is what's being added:

<a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/1.0/gocomments/bandonrandon.wordpress.com/87/"&gt;
    <img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bandonrandon.wordpress.com/87/"/&gt;&lt;/a&gt;
    <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bandonrandon.wordpress.com&amp;blog=1046814&amp;post=87&amp;subd=bandonrandon&amp;ref=&amp;feed=1" width="1" height="1"/>

I edited out some of the services but you get the idea. I tried to use regex to remove this content what I tried was this:

<a rel="nofollow" target="_blank" href="http://feeds.wordpress.com/.*?&gt;&lt;img alt="" border="0" src="http://feeds.wordpress.com.*?&gt;&lt;/a&gt;

and

<img alt="" border="0" src="http://stats.wordpress.com.*?&gt;

however it didn't fileter the results at all. Using this would filter ALL images and works fine

<a.*?><img.*?></a>

Any Help would be great

+1  A: 
<a[^>]+href="http://feeds.wordpress.com[^"]*"[^&gt;]*&gt;\s*&lt;img[^&gt;]+src="http://feeds.wordpress.com/[^"]*"[^&gt;]*&gt;\s*&lt;/a&gt;\s*&lt;img[^&gt;]+src="http://stats.wordpress.com/[^"]*"[^&gt;]*&gt;

Regex updated, try that to match the whole lot.

rrrr
Thanks for your help. It's however still not working. If you want to play with the pipe feel free: http://pipes.yahoo.com/bandonrandon/wordpress_feed
BandonRandon
The original regex worked in my test scenario, after a bit of learning of this pipes thing and a quick play around hopefully the above should work :)
rrrr
It worked but I had to make it two request. I had to put stats on a seperate line from feeds. I forgot to mention there are like 10 services of feeds then the stat link. You're welcome to follow the link above to see the end result.
BandonRandon