nishino_ameblo_easy Fork

    @@ -1,4 +1,5 @@ // ==UserScript== + // @title nishino_ameblo_easy // @name nishino_ameblo_easy // @namespace http://tampermonkey.net/ // @version 0.1
    @@ -19,11 +20,6 @@ $('.anc').replaceWith(function () { return $(this).contents(); }); - $(".skin-entryBody>br").wrap("<div class='div_br'></div>"); - var result3 = document.evaluate('//div[@class="skin-entryBody"]/div[not(@class="div_br")][last()]', document, null, 7, null); - for (var k = 0; k < result3.snapshotLength; k++) { - result3.snapshotItem(k).classList.add("div_last"); - } //空div処理 var result4 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[not(./*)][not(self::br) and not(self::img) and not(self::iframe) and not(self::amp-img)]/text()', document, null, 7, null); var result5 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[not(./*)][not(self::br) and not(self::img) and not(self::iframe) and not(self::amp-img)][./text()]', document, null, 7, null);
    @@ -31,6 +27,16 @@ if (/\s/g.test(result4.snapshotItem(x).nodeValue)) { result5.snapshotItem(x).remove(); } + } + var result6 = document.evaluate('//div[@class="skin-entryBody"]//*[not(./node())][not(self::br) and not(self::img) and not(self::iframe) and not(self::amp-img)]|//div[@class="skin-entryBody"]//*[not(./node())][not(self::br) and not(self::img) and not(self::iframe) and not(self::amp-img)]/ancestor::*[./ancestor::div[@class="skin-entryBody"] and not(self::a)]', document, null, 7, null); + for (var y = 0; y < result6.snapshotLength; y++) { + result6.snapshotItem(y).remove(); + } + //lastbr処理 + $(".skin-entryBody>br").wrap("<div class='div_br'></div>"); + var result3 = document.evaluate('//div[@class="skin-entryBody"]/div[not(@class="div_br")][last()]', document, null, 7, null); + for (var k = 0; k < result3.snapshotLength; k++) { + result3.snapshotItem(k).classList.add("div_last"); } //first_text処理 var result10 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/descendant::*[self::div or self::td][1]', document, null, 7, null);
  • // ==UserScript==
    // @title        nishino_ameblo_easy
    // @name         nishino_ameblo_easy
    // @namespace    http://tampermonkey.net/
    // @version      0.1
    // @description  try to take over the world!
    // @author       You
    // @match        https://ameblo.jp/nishino-akihiro/*
    // @grant        none
    // @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
    // ==/UserScript==
    var result = document.evaluate('//div[@class="skin-entryBody"]//br/ancestor::*[./ancestor::div[@class="skin-entryBody"] and not(self::a)]', document, null, 7, null);
    for (var i = 0; i < result.snapshotLength; i++) {
      result.snapshotItem(i).classList.add("anc");
    }
    var result2 = document.evaluate('//div[@class="skin-entryBody"]//*[./text()]/ancestor::*[./ancestor::div[@class="skin-entryBody"] and not(self::a)]', document, null, 7, null);
    for (var j = 0; j < result2.snapshotLength; j++) {
      result2.snapshotItem(j).classList.add("anc");
    }
    $('.anc').replaceWith(function () {
      return $(this).contents();
    });
    //空div処理
    var result4 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[not(./*)][not(self::br) and  not(self::img) and  not(self::iframe) and not(self::amp-img)]/text()', document, null, 7, null);
    var result5 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[not(./*)][not(self::br) and  not(self::img) and  not(self::iframe) and not(self::amp-img)][./text()]', document, null, 7, null);
    for (var x = 0; x < result4.snapshotLength; x++) {
      if (/\s/g.test(result4.snapshotItem(x).nodeValue)) {
        result5.snapshotItem(x).remove();
      }
    }
    var result6 = document.evaluate('//div[@class="skin-entryBody"]//*[not(./node())][not(self::br) and  not(self::img) and  not(self::iframe) and not(self::amp-img)]|//div[@class="skin-entryBody"]//*[not(./node())][not(self::br) and  not(self::img) and  not(self::iframe) and not(self::amp-img)]/ancestor::*[./ancestor::div[@class="skin-entryBody"] and not(self::a)]', document, null, 7, null);
    for (var y = 0; y < result6.snapshotLength; y++) {
      result6.snapshotItem(y).remove();
    }
    //lastbr処理
    $(".skin-entryBody>br").wrap("<div class='div_br'></div>");
    var result3 = document.evaluate('//div[@class="skin-entryBody"]/div[not(@class="div_br")][last()]', document, null, 7, null);
    for (var k = 0; k < result3.snapshotLength; k++) {
      result3.snapshotItem(k).classList.add("div_last");
    }
    //first_text処理
    var result10 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/descendant::*[self::div or self::td][1]', document, null, 7, null);
    result10.snapshotItem(0).classList.add("div_second");
    result10.snapshotItem(0).insertAdjacentHTML("afterbegin", " ");
    var tmp = [];
    var e_text = $(".skin-entryBody").text();
    tmp = e_text.split(" ");
    var n_text = tmp[0];
    var result12 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]', document, null, 7, null);
    result12.snapshotItem(0).insertAdjacentHTML("afterbegin", "<div class='div_first'>" + n_text + "</div> ");
    var result13 = document.evaluate('//div[@class="div_first"]/following-sibling::node()[./following-sibling::*[self::div or self::td][contains(@class,"div_second")]]', document, null, 7, null);
    for (var e = 0; e < result13.snapshotLength; e++) {
      result13.snapshotItem(e).remove();
    }
    //td回り込み
    $(".skin-entryBody>td+a+div").next().addClass("td_after");
    var listArray = document.querySelectorAll('.skin-entryBody>.td_after');
    for (var a = 0; a < listArray.length; a++) {
      listArray[a].insertAdjacentHTML("afterend", "<div></div>");
    }
    //改行処理
    var listArray2 = document.querySelectorAll('.skin-entryBody>a+iframe');
    for (var b = 0; b < listArray2.length; b++) {
      listArray2[b].insertAdjacentHTML("beforebegin", "<div></div>");
    }
    var listArray3 = document.querySelectorAll('.skin-entryBody>td');
    for (var c = 0; c < listArray3.length; c++) {
      listArray3[c].insertAdjacentHTML("beforebegin", "<div></div>");
    }
  • Permalink
    このページへの個別リンクです。
    RAW
    書かれたコードへの直接のリンクです。
    Packed
    文字列が圧縮された書かれたコードへのリンクです。
    Userscript
    Greasemonkey 等で利用する場合の .user.js へのリンクです。
    Loader
    @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
    Metadata
    コード中にコメントで @xxx と書かれたメタデータの JSON です。

History

  1. 2019/02/28 01:43:44 - 02/28
  2. 2019/02/28 01:28:25 - 02/28
  3. 2019/02/23 03:51:40 - 02/23
  4. 2019/02/21 10:39:10 - 02/21
  5. 2019/02/21 10:14:33 - 02/21
  6. 2019/02/21 03:40:03 - 02/21
  7. 2019/02/20 01:18:53 - 02/20
  8. 2019/02/18 02:18:59 - 02/18
  9. 2019/02/12 08:50:00 - 02/12
  10. 2019/02/12 06:23:04 - 02/12
  11. 2019/02/12 02:41:48 - 02/12
  12. 2019/02/12 01:40:35 - 02/12
  13. 2019/02/07 03:37:14 - 02/07
  14. 2019/02/07 03:36:42 - 02/07
  15. 2019/02/06 08:41:20 - 02/06
  16. 2019/02/06 01:34:46 - 02/06
  17. 2019/02/06 01:31:22 - 02/06
  18. 2019/02/04 05:44:14 - 02/04
  19. 2019/02/03 12:19:32 - 02/03
  20. 2019/02/03 02:34:12 - 02/03
  21. 2019/02/03 01:31:28 - 02/03
  22. 2019/02/02 04:03:45 - 02/02
  23. 2019/01/29 01:07:09 - 01/29
  24. 2019/01/27 07:16:40 - 01/27
  25. 2019/01/24 00:29:39 - 01/24
  26. 2019/01/23 11:03:10 - 01/23
  27. 2019/01/23 05:01:49 - 01/23
  28. 2019/01/23 03:51:26 - 01/23
  29. 2019/01/15 07:43:46 - 01/15
  30. 2019/01/15 07:30:36 - 01/15
  31. 2019/01/07 05:36:43 - 01/07
  32. 2019/01/04 11:39:14 - 01/04
  33. 2019/01/02 02:12:02 - 01/02
  34. 2018/12/27 01:21:31 - 2018-12-27
  35. 2018/12/25 03:31:16 - 2018-12-25
  36. 2018/12/24 04:46:48 - 2018-12-24
  37. 2018/12/24 04:42:15 - 2018-12-24
  38. 2018/12/24 01:07:19 - 2018-12-24
  39. 2018/12/24 00:54:42 - 2018-12-24
  40. 2018/11/15 09:38:44 - 2018-11-15
  41. 2018/11/14 06:56:02 - 2018-11-14
  42. 2018/11/14 06:03:12 - 2018-11-14
  43. 2018/11/12 10:51:00 - 2018-11-12
  44. 2018/11/12 05:17:55 - 2018-11-12
  45. 2018/11/12 04:29:22 - 2018-11-12
  46. 2018/11/12 04:26:24 - 2018-11-12
  47. 2018/11/09 05:54:43 - 2018-11-09
  48. 2018/11/05 12:52:21 - 2018-11-05
  49. 2018/11/05 12:06:35 - 2018-11-05