Show
Ignore:
Timestamp:
08/03/08 20:23:53 (4 months ago)
Author:
cho45
Message:

広告のクラスよけ

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/userscripts/hatena.haiku.expandrepliestree.user.js

    r17021 r17022  
    143143                                                // remove unnecessary tags 
    144144                                                var t = h(data.responseText.replace(/<\/?(?:script|i?frame)[^>]*>/g, "")); 
    145                                                 return parallel($X(".//div[@class='entries']/div[@class='entry']", t).map(appendAndLoadNext)); 
     145                                                return parallel($X(".//div[@class='entries']/div[@class='entry' and not(@class='ad')]", t).map(appendAndLoadNext)); 
    146146                                        }); 
    147147 
     
    156156                                                // 時系列に並ぶ様に注意する 
    157157                                                var time = $X("string(div/div/span[@class='timestamp']/a)", e); 
    158                                                 var ref = $X("./div[@class='entry']", body).filter(function (i) { 
     158                                                var ref = $X("./div[@class='entry' and not(@class='ad')]", body).filter(function (i) { 
    159159                                                        return $X("string(div/div/span[@class='timestamp']/a)", i) < time; 
    160160                                                })[0]; 
     
    193193        next(function () { 
    194194 
    195                 var n = $X("count(//div[@class='entries']/div[@class='entry'])"); 
     195                var n = $X("count(//div[@class='entries']/div[@class='entry' and not(@class='ad')])"); 
    196196                if (num < n) { 
    197                         var entries = $X("//div[@class='entries']/div[@class='entry'][.//img[@alt='Reply to'] or .//span[@class='replies']/a]"); 
     197                        var entries = $X("//div[@class='entries']/div[@class='entry' and not(@class='ad')][.//img[@alt='Reply to'] or .//span[@class='replies']/a]"); 
    198198                        loop(entries.length, function (n) { 
    199199                                var e = entries[n].wrappedJSObject || entries[n];