-1

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/">
    <img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bandonrandon.wordpress.com/87/"/></a>
    <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bandonrandon.wordpress.com&blog=1046814&post=87&subd=bandonrandon&ref=&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/.*?><img alt="" border="0" src="http://feeds.wordpress.com.*?></a>

and

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

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

<a.*?><img.*?></a>
bjb568
  • 11,089
  • 11
  • 50
  • 71
Brooke.
  • 3,691
  • 13
  • 49
  • 80

1 Answers1

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

Regex updated, try that to match the whole lot.

rrrr-o
  • 2,447
  • 2
  • 24
  • 52
  • 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 – Brooke. Sep 01 '10 at 20:24
  • 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-o Sep 02 '10 at 08:45
  • 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. – Brooke. Sep 02 '10 at 21:27