Changeset 251

Show
Ignore:
Timestamp:
03/03/06 12:17:05
Author:
miyagawa
Message:

Support alternative Google AdSense? format, along with Bloglines munged feed workaround.

Files:

Legend:

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

    r211 r251  
    2525 
    2626    # plaza.rakuten.co.jp 
    27     my $count = $body =~ s!<br clear?=all /><br><SMALL>\n(?:<SCRIPT LANGUAGE="Javascript">\n<\!--\nfunction random\(\).*?infoseek.*?RssPlaza.*</SCRIPT>)?\n<NOSCRIPT>.*?infoseek.*?RssPlaza.*?</NOSCRIPT>\n</SMALL>!!s; 
     27    $count = $body =~ s!<br clear?=all /><br><SMALL>\n(?:<SCRIPT LANGUAGE="Javascript">\n<\!--\nfunction random\(\).*?infoseek.*?RssPlaza.*</SCRIPT>)?\n<NOSCRIPT>.*?infoseek.*?RssPlaza.*?</NOSCRIPT>\n</SMALL>!!s; 
    2828    Plagger->context->log(debug => "Stripped plaza.rakuten ad") if $count; 
    2929 
    3030    # Google AdSense for Feeds 
    31     my $count = $body =~ s!<p><map name="google_ad_map_\d+\-\d+"><area.*?></map><img usemap="#google_ad_map_\d+-\d+" border="0" src="http://imageads\.googleadservices\.com/pagead/ads\?.*?" /></p>!!; 
     31    $count = $body =~ s!<p><map name="google_ad_map_\d+\-\d+"><area.*?></map><img usemap="#google_ad_map_\d+-\d+" border="0" src="http://imageads\.googleadservices\.com/pagead/ads\?.*?" /></p>!!; 
     32 
     33    # 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; 
     35 
    3236    Plagger->context->log(debug => "Stripped Google AdSense for feeds") if $count; 
    3337