Changeset 29981

Show
Ignore:
Timestamp:
02/12/09 23:47:01 (4 years ago)
Author:
drry
Message:
  • fixed 2 filters.
    • "FeedBurner? - Extinguish burning feeds"
    • "RSS Ads - Remove Trend Match, solve Feed Metrix"
  • et cetera.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/ldrprefav.user.js

    r26150 r29981  
    2525        const filters = { 
    2626                "FeedBurner - Extinguish burning feeds" : function(f) { 
    27                         var re = /<a(?: [^>]+?)? href="[ \t\r\n]*http:\/\/[^\/]+\/~\w\/[^>]+>[\s\S]+?<\/a>|<img(?: [^>]+?)? src="[ \t\r\n]*http:\/\/[^\/]+\/~\w\/[^>]+>(?:<\/img>)?/g; 
    28                         if (! /^http:\/\/feed(?:s\.feedburner\.(?:com|jp)|proxy\.google\.com)\//.test(f.channel.feedlink) && 
     27                        var re = /<a(?: [^>]+?)? href="http:\/\/(?:[^\/]+\/~[a-z0-9]|feedads\.googleadservices\.com)\/[^>]+>[\s\S]+?<\/a>|<img(?: [^>]+?)? src="http:\/\/(?:[^\/]+\/~[a-z0-9]|feedads\.googleadservices\.com)\/[^>]+>(?:<\/img>)?/g; 
     28                        if (! /^http:\/\/feed(?:s2?\.feedburner\.(?:com|jp)|proxy\.google\.com)\//.test(f.channel.feedlink) && 
    2929                            ! (f.items[0] && 
    3030                               (/^http:\/\/[^\/]+\/~r\/[^~]+?\/~\d\//.test(f.items[0].link) || 
    3131                                re.test(f.items[0].body)))) return; 
    3232 
    33                         filter(f.items, function(i) { return i.body.replace(/[^?]+/g, "").length < i.body.length / 10 }); 
     33                        filter(f.items, function(i) i.body.replace(/[^?]+/g, "").length < i.body.length / 10); 
    3434                        foreach(f.items, function(i) { 
    3535                                i.body = i.body.replace(re, ""); 
     
    4545                        if (! (item && /^http:\/\/[^\/]+\/click\.phdo\?/.test(item.link))) return; 
    4646 
    47                         filter(f.items, function(i) { return i.title.indexOf("AD: ") != 0 }); 
     47                        filter(f.items, function(i) i.title.indexOf("AD: ") != 0); 
    4848                        var re = /<img(?: [^>]+?)? src="[ \t\r\n]*http:\/\/www\.pheedo\.jp\/(?:img\.phdo|feeds\/tracker\.php)\?[^>]+>(?:<\/img>)?/g; 
    4949                        foreach(f.items, function(i) { 
     
    5656                }, 
    5757                "RSS Ads - Remove Trend Match, solve Feed Metrix" : function(f) { 
    58                         //filter(f.items, function(i) { return i.author != "rssad.jp" }); 
    59                         filter(f.items, function(i) { return i.title.indexOf("PR: ") != 0 }); 
    60                         var re = /<a(?: [^>]+?)? href="[ \t\r\n]*http:\/\/rss\.rssad\.jp\/[^>]+>[\s\S]+?<\/a>|<img(?: [^>]+?)? src="[ \t\r\n]*http:\/\/rss\.rssad\.jp\/[^>]+>(?:<\/img>)?/g; 
     58                        //filter(f.items, function(i) i.author != "rssad.jp"); 
     59                        filter(f.items, function(i) i.title.indexOf("PR: ") != 0); 
     60                        var re = /<a(?: [^>]+?)? href="[ \t\r\n]*http:\/\/rss\.rssad\.jp\/[^>]+>[\s\S]+?<\/a>|<img(?: [^>]+?)? src="[ \t\r\n]*http:\/\/rss\.rssad\.jp\/[^>]+>(?:<\/img>)?|<a(?: [^>]+?)? href="[^"]+?\/ck\.php\?[^>]+><img(?: [^>]+?)? src="[^"]+?\/avw\.php\?[^>]+>(?:<\/img>)?/g; 
    6161                        foreach(f.items, function(i) { 
    6262                                i.body = i.body.replace(re, ""); 
     
    9393                        if (! /^http:\/\/[^.]+\.seesaa\.net\//.test(f.channel.link)) return; 
    9494 
    95                         filter(f.items, function(i) { return i.link.indexOf("http://match.seesaa.jp/") != 0 }); 
     95                        filter(f.items, function(i) i.link.indexOf("http://match.seesaa.jp/") != 0); 
    9696                }, 
    9797                "Userscripts.org - Trim spam" : function(f) { 
    9898                        if (f.channel.link.indexOf("//userscripts.org/") < 0) return; 
    9999 
    100                         filter(f.items, function(i) { return i.title.toLowerCase().indexOf("scrap") < 0 }); 
     100                        filter(f.items, function(i) i.title.toLowerCase().indexOf("scrap") < 0); 
    101101                }, 
    102102                "National Geographic News - Enlarge photos" : function(f) { 
     
    134134                }, 
    135135                "livedoor Blog - Enlarge thumbnails" : function(f) { 
    136                         if (//! f.items.some(function(i) { return i.body.indexOf('"http://image.blog.livedoor.jp/') > -1 }) && 
     136                        if (//! f.items.some(function(i) i.body.indexOf('"http://image.blog.livedoor.jp/') > -1) && 
    137137                            ! /^http:\/\/(?:blog|[^.]+)\.livedoor\.(?:jp|biz)\//.test(f.channel.link)) return; 
    138138 
     
    239239                        foreach(f.items, function(i) { 
    240240                                if (i.link.indexOf("/photos/cns!") < 0) { 
    241                                         i.link = i.link.replace(re1, function(m) { return m.toLowerCase() }); 
     241                                        i.link = i.link.replace(re1, function(m) m.toLowerCase()); 
    242242                                        i.body = i.body.replace(re2, ""); 
    243243                                } else 
     
    431431} 
    432432 
    433 function isFiltered(n) { return filteredIDs.indexOf(parseInt(n)) > -1 }; 
    434 function isPreFiltered(n) { return preFilteredIDs.indexOf(parseInt(n)) > -1 }; 
     433function isFiltered(n) filteredIDs.indexOf(parseInt(n)) > -1; 
     434function isPreFiltered(n) preFilteredIDs.indexOf(parseInt(n)) > -1;