nishino_gamp Fork

    @@ -21,15 +21,9 @@ $(".entry-text").children("td:lt(2)").wrapAll('<div class="tb_cell"></div>') } while ($(".entry-text").children("td").length); }); - $(".entry-text span").removeClass(); - var listArray3 = document.querySelectorAll('.entry-text b,.entry-text i,.entry-text font,.entry-text u,.entry-text em'); - for (var k = 0; k < listArray3.length; k++) { - listArray3[k].classList.add("fbi"); - } - $('.entry-text a:not([href])').contents().unwrap(); - $('.fbi').wrap("<span class='s_fbi'></span>"); + $('.entry-text b,.entry-text i,.entry-text font,.entry-text u').addClass("fbi"); $('.fbi').contents().unwrap(); - $('.entry-text span>span').parent().contents().unwrap(); + $('.entry-text span').removeClass( ); $('.entry-text span>br').parent().contents().unwrap(); var result5 = document.evaluate('//div[@class="entry-text"]//text()', document, null, 7, null); for (var b = 0; b < result5.snapshotLength; b++) {
    @@ -41,28 +35,26 @@ } } } - var result6 = document.evaluate('//div[@class="entry-text"]//*[self::div or self::p][./text()=" "][not(./*)]|//div[@class="entry-text"]//*[self::div or self::p][./span[./text()=" "][not(./*)]]', document, null, 7, null); + var result6 = document.evaluate('//div[@class="entry-text"]/*[self::div or self::p][./text()=" "][not(./*)]|//div[@class="entry-text"]/*[self::div or self::p][./span[./text()=" "][not(./*)]]', document, null, 7, null); for (var c = 0; c < result6.snapshotLength; c++) { result6.snapshotItem(c).classList.add("div_br"); } - var result4 = document.evaluate('//div[@class="entry-text"]//div[contains(text(),"━") or contains(text(),"==")]|//div[@class="entry-text"]//div[./span[contains(text(),"━") or contains(text(),"==")]]', document, null, 7, null); - for (var a = 0; a < result4.snapshotLength; a++) { - result4.snapshotItem(a).classList.add("l_yoko"); - } var result = document.evaluate('//div[@class="entry-text"]//*[self::div or self::p]/br[not(./preceding-sibling::*) and string-length(./preceding-sibling::text())<1]', document, null, 7, null); for (var x = 0; x < result.snapshotLength; x++) { result.snapshotItem(x).classList.add("br_first"); } $(".br_first").wrap("<div class='div_br'></div>"); $('.entry-text div>div,.entry-text p>div,.entry-text div>p').parent().contents().unwrap(); - $(".entry-text").contents().filter(function () { - return this.nodeType === 3; - }).wrap("<span class='n_text'></span>"); - $('.entry-text span:empty').remove(); - $('.entry-text div:empty').remove(); - $(".entry-text div+br").wrap("<div class='div_br'></div>"); - var result3 = document.evaluate('//div[@class="entry-text"]/*[not(@class="div_br") and not(self::td)][last()]', document, null, 7, null); + var result8 = document.evaluate('//div[@class="entry-text"]/*[self::div or self::p][contains(text(),"━") or contains(text(),"==")]|//div[@class="entry-text"]/*[self::div or self::p][./span[contains(text(),"━") or contains(text(),"==")]]', document, null, 7, null); + for (var a = 0; a < result8.snapshotLength; a++) { + result8.snapshotItem(a).classList.add("l_yoko"); + } + $('.l_yoko+*+.l_yoko').prev().addClass("s_title"); + var result3 = document.evaluate('//div[@class="entry-text"]/*[not(@class="div_br")][last()]', document, null, 7, null); result3.snapshotItem(0).classList.add("node_last"); - $(".node_last~td").prev().addClass("tomeo"); + var result4 = document.evaluate('//div[@class="entry-text"]/*[not(@class="div_br")][1]', document, null, 7, null); - $('.l_yoko').prev().addClass("sun"); + result4.snapshotItem(0).classList.add("node_first"); - $('.entry-text>a[href*="/image-"],.entry-text>amp-youtube,.entry-text>amp-iframe').addClass("i_pic");+ var result7 = document.evaluate('//*[contains(@class,"node_first")]/preceding-sibling::*', document, null, 7, null); + for (var y = 0; y < result7.snapshotLength; y++) { + result7.snapshotItem(y).classList.add("cork"); + }
  • // ==UserScript==
    // @title        nishino_gamp
    // @name         nishino_gamp
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        https://gamp.ameblo.jp/nishino-akihiro*
    // @grant        none
    // @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
    // ==/UserScript==
    var result2 = document.evaluate('//div[@class="entry-text"]//td/ancestor::*[./ancestor::div[@class="entry-text"]]', document, null, 7, null);
    for (var i = 0; i < result2.snapshotLength; i++) {
      result2.snapshotItem(i).classList.add("anc");
    }
    $('.anc').replaceWith(function () {
      return $(this).contents();
    });
    $(function () {
      do {
        $(".entry-text").children("td:lt(2)").wrapAll('<div class="tb_cell"></div>')
      } while ($(".entry-text").children("td").length);
    });
    $('.entry-text b,.entry-text i,.entry-text font,.entry-text u').addClass("fbi");
    $('.fbi').contents().unwrap();
    $('.entry-text span').removeClass( );
    $('.entry-text span>br').parent().contents().unwrap();
    var result5 = document.evaluate('//div[@class="entry-text"]//text()', document, null, 7, null);
    for (var b = 0; b < result5.snapshotLength; b++) {
      if (/^\s+$/g.test(result5.snapshotItem(b).nodeValue)) {
        if (/ /g.test(result5.snapshotItem(b).nodeValue)) {
          result5.snapshotItem(b).nodeValue = " ";
        } else {
          result5.snapshotItem(b).nodeValue = result5.snapshotItem(b).nodeValue.replace(/^\s+/g, "");
        }
      }
    }
    var result6 = document.evaluate('//div[@class="entry-text"]/*[self::div or self::p][./text()=" "][not(./*)]|//div[@class="entry-text"]/*[self::div or self::p][./span[./text()=" "][not(./*)]]', document, null, 7, null);
    for (var c = 0; c < result6.snapshotLength; c++) {
      result6.snapshotItem(c).classList.add("div_br");
    }
    var result = document.evaluate('//div[@class="entry-text"]//*[self::div or self::p]/br[not(./preceding-sibling::*) and string-length(./preceding-sibling::text())<1]', document, null, 7, null);
    for (var x = 0; x < result.snapshotLength; x++) {
      result.snapshotItem(x).classList.add("br_first");
    }
    $(".br_first").wrap("<div class='div_br'></div>");
    $('.entry-text div>div,.entry-text p>div,.entry-text div>p').parent().contents().unwrap();
    var result8 = document.evaluate('//div[@class="entry-text"]/*[self::div or self::p][contains(text(),"━") or contains(text(),"==")]|//div[@class="entry-text"]/*[self::div or self::p][./span[contains(text(),"━") or contains(text(),"==")]]', document, null, 7, null);
    for (var a = 0; a < result8.snapshotLength; a++) {
      result8.snapshotItem(a).classList.add("l_yoko");
    }
    $('.l_yoko+*+.l_yoko').prev().addClass("s_title");
    var result3 = document.evaluate('//div[@class="entry-text"]/*[not(@class="div_br")][last()]', document, null, 7, null);
    result3.snapshotItem(0).classList.add("node_last");
    var result4 = document.evaluate('//div[@class="entry-text"]/*[not(@class="div_br")][1]', document, null, 7, null);
    result4.snapshotItem(0).classList.add("node_first");
    var result7 = document.evaluate('//*[contains(@class,"node_first")]/preceding-sibling::*', document, null, 7, null);
    for (var y = 0; y < result7.snapshotLength; y++) {
      result7.snapshotItem(y).classList.add("cork");
    }
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。