Changeset 394

Show
Ignore:
Timestamp:
03/13/06 18:16:02
Author:
miyagawa
Message:

Added new pattern for Google AdSense? Feeds. Fixes #126

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/StripRSSAd.pm

    r350 r394  
    3232 
    3333    # Google AdSense for Feeds, part 2. 
    34     $count += $body =~ s!<table [^>]*>\n\s*<tr>\n\s*<td><(?:defanged-)?span[^>]*> <br[^>]*></(?:defanged-)?span></td>\n\s*</tr>\s*\n\s*<tr>\n\s*<td><a href="http://imageads\.googleadservices\.com/pagead/imgclick/[^"]*"[^>]*>\n<img [^>]* src="http://imageads\.googleadservices\.com/pagead/ads\?[^"]*" / ></a></td>\n\s*</tr>\n\s*<tr>\n\s*<td><div align="right"><a href="http://www\.google\.com/ads_by_google\.html" [^>]*>Ads by Google</a></div></td>\n\s*</tr>\n\s*</table>!!s; 
     34    $count += $body =~ s!<table [^>]*>\n\s*(?:<tr>\n\s*<td><(?:defanged-)?span[^>]*> <br[^>]*></(?:defanged-)?span></td>\n\s*</tr>\s*\n\s*)?<tr>\n\s*<td><a href="http://imageads\.googleadservices\.com/pagead/imgclick/[^"]*"[^>]*>\n<img [^>]* src="http://imageads\.googleadservices\.com/pagead/ads\?[^"]*" / ?></a></td>\n\s*</tr>\n\s*<tr>\n\s*<td><div align="right">(?:<font [^>]*>)?<a href="http://www\.google\.com/ads_by_google\.html" [^>]*>Ads by Google</a>(?:</font>)?</div></td>\n\s*</tr>\n\s*</table>!!s; 
    3535 
    3636    Plagger->context->log(debug => "Stripped Google AdSense for feeds") if $count;