1300

移行用のテストです

西野ブログ対策改訂版

http://let.hatelabo.jp/jigendaddy/let/hLHV2MrN4-QD.js

// ==UserScript==
// @name         nishino_ameblo_kdiv
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @match        https://gamp.ameblo.jp/nishino-akihiro/entry*
// @grant        none
// ==/UserScript==
while (document.getElementById("test2") == null) {
  var result = 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)]', 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 i = 0; i < result5.snapshotLength; i++) {
    //ゼロ幅スペース削除
    result5.snapshotItem(i).nodeValue = result5.snapshotItem(i).nodeValue.replace(/\u200B/g, "");
    //連続スペースを全角スペースに
    result5.snapshotItem(i).nodeValue = result5.snapshotItem(i).nodeValue.replace(/\s\s+/g, ' ');
    //全角スペース判定で改行とみなす
    if (/ /g.test(result5.snapshotItem(i).nodeValue)) {
      result.snapshotItem(i).classList.add("div_br");
    }
    //半角スペース判定でスペース削除
    else if (/ /g.test(result5.snapshotItem(i).nodeValue)) {
      result5.snapshotItem(i).nodeValue = result5.snapshotItem(i).nodeValue.replace(/\s/g, '');
    }
    result.snapshotItem(i).dataset.content = result5.snapshotItem(i).nodeValue;
    /*if(result.snapshotItem(i).dataset.content=="")
    {
        result.snapshotItem(i).remove();
    }*/
  }
  var result2 = document.evaluate('descendant::div[@data-content][1]', document, null, 7, null);
  result2.snapshotItem(0).id = "test2";
}
//改行クラスを持たずにスペースのあるタグ削除
var result4 = document.evaluate('//*[not(@class="div_br")][@data-content]', document, null, 7, null)
for (var k = 0; k < result4.snapshotLength; k++) {
  if (/\s/g.test(result4.snapshotItem(k).firstChild.nodeValue)) {
    result4.snapshotItem(k).remove();
  }
}
//テキスト中のスぺースの場合改行クラス削除
var result3 = document.evaluate('//*[@class="div_br"][string-length(@data-content)>1]', document, null, 7, null)
for (var j = 0; j < result3.snapshotLength; j++) {
  result3.snapshotItem(j).classList.remove("div_br");
}

http://let.hatelabo.jp/jigendaddy/let/hLHV3Lugy5w-.js

// ==UserScript==
// @name         nishino_ameblo_br_a
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @match        https://gamp.ameblo.jp/nishino-akihiro/entry*
// @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" or @class="entry-text"]//*[self::div or self::p][not(.//text() or .//img or .//iframe)]', document, null, 7, null);
for (var i = 0; i < result.snapshotLength; i++) {
  result.snapshotItem(i).classList.add("div_br");
}
//消しきれない空div削除
/*var result2 = document.evaluate('//div[@class="div_br"][not(.//br)]', document, null, 7, null);
for (var z = 0; z < result2.snapshotLength; z++) {
  result2.snapshotItem(z).remove();
}*/
//lastdiv処理
var result4 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/descendant::div[not(@class)][last()][./following-sibling::div[@class="div_br"] and ./preceding-sibling::div[@class="div_br"]]|descendant::div[@class="div_br"][last()]/preceding-sibling::div[not(@class)][1]', document, null, 7, null);
for (var k = 0; k < result4.snapshotLength; k++) {
  result4.snapshotItem(k).classList.add("div_last");
}
var result3 = document.evaluate('//div[@class="div_last"][./following-sibling::div[not(@class)]]', document, null, 7, null);
for (var j = 0; j < result3.snapshotLength; j++) {
  result3.snapshotItem(j).classList.remove("div_last");
}

http://let.hatelabo.jp/jigendaddy/let/hLHV3LujzYR-.js

// ==UserScript==
// @name         nishino_ameblo_br_b
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @match        https://gamp.ameblo.jp/nishino-akihiro/entry*
// @grant        none
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
// ==/UserScript==
//div[./lastbr]にクラス付加
var result5 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//div[not(@class) or @id][./*[contains(@class,"div_br") or contains(@class,"div_and_n_br")][last()][not(./following-sibling::node()[string-length(normalize-space())>1])]]', document, null, 7, null);
for (var x = 0; x < result5.snapshotLength; x++) {
  result5.snapshotItem(x).classList.add("child_br_last");
}
//child_br_lastクラスの祖先ノードにクラス付加
var result6 = document.evaluate('//div[contains(@class,"child_br_last")]/ancestor::div[not(@class)]', document, null, 7, null);
for (var y = 0; y < result6.snapshotLength; y++) {
  result6.snapshotItem(y).classList.add("div_child_br_last");
}
//エントリ外のdiv_child_br_lastクラス削除
var result7 = document.evaluate('//div[@class="div_child_br_last"][.//div[@class="skin-entryBody" or @class="entry-text"]]', document, null, 7, null);
for (var c = 0; c < result7.snapshotLength; c++) {
  result7.snapshotItem(c).classList.remove("div_child_br_last");
}
//div_child_br_lastのツリー構造を破壊
$(function () {
  $("div.div_child_br_last").replaceWith(function () {
    return $(this).contents();
  });
});
var result8 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//div[./text()[string-length(normalize-space())>1][./following-sibling::* or ./preceding-sibling::*]]', document, null, 7, null);
for (var j = 0; j < result8.snapshotLength; j++) {
  //result8.snapshotItem(j).insertAdjacentHTML("afterbegin","<div></div>");
  result8.snapshotItem(j).insertAdjacentHTML("beforeend", "<div></div>");
}

nishino_ameblo_br_cは実験的なスクリプトです。一部タグが確保できない場合があるのでご注意ください
http://let.hatelabo.jp/jigendaddy/let/hLHV3Luqwdg7.js

// ==UserScript==
// @name         nishino_ameblo_br_c
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://ameblo.jp/nishino-akihiro/entry*
// @match        https://gamp.ameblo.jp/nishino-akihiro/entry*
// @grant        none
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js
// ==/UserScript==
var result10 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/descendant::div[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::div[contains(@class,"div_second")]]', document, null, 7, null);
for (var i = 0; i < result13.snapshotLength; i++) {
  result13.snapshotItem(i).remove();
}

var result9 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//div[@class="div_br" or @class="child_br_last"][./following-sibling::text()[string-length(normalize-space())>1][./following-sibling::div[@class="div_br"] or self::br]][last()]', document, null, 7, null);
result9.snapshotItem(0).insertAdjacentHTML("afterend", "<div></div>");

http://scratchpad.io/salty-print-244

.div_br{line-height:1;}

.div_br+.div_br{display:none;}
.div_br+br{display:none;}

.div_br+:not(.div_br) .div_br:first-child{display:none;}
.div_br+:not(.div_br)>br:first-child{display:none;}

.child_br_last+.div_br{display:none;}
.div_br+.child_br_last>.child_br_last:not(:first-child)>.div_br:first-child{display:block;}
/*.div_br_first~:not(.div_br)+.child_br_last>.div_br_first{display:block;}*/

/*.skin-entryBody>br:first-of-type+div:not(.div_br){padding-top:1em;}
.skin-entryBody>br:first-of-type+div:not(.div_br)>.div_br:first-child{display:none;}
.skin-entryBody>div:first-child>.div_br:first-child{display:none;}
.entry-text>div:first-child>div:first-child>.div_br:first-child{display:none;}*/

.div_last>.div_br:last-child{display:none;}
.div_last+.div_br{display:none;}
/*.skin-entryBody *{font-size:medium !important;}
.hashtag-module__item {line-height:1;}
*/
.skin-entryBody *{margin:0 !important;padding:0;}
.div_br font{font-size:medium;}
font[size="7"]{line-height:1;}

.LazyLoad{display:none;}
.js-blogGenreRank{display:none;}
.skin-entryBody{margin:0;padding:0;}
.skin-entryHead{margin:0;padding:0;}
.hashtag-module-borderTop{margin:0;padding:0;}
.skin-entryThemes{margin:0;padding:0;}
#conversation-footer{height:auto !important;}

/*for gamp*/
article.entry{margin:0;padding-bottom:0;}
article.entry>div:first-child{margin:0;padding-bottom:0;}
.i-amphtml-layout-container, .i-amphtml-layout-fixed-height, [layout="container"], [layout="fixed-height"][height]{height:35px !important;}
.entry amp-img[src*="/user_images/"][layout="responsive"]{margin:0;}
/*for novel*/
/*.skin-entryBody div:empty{display:none;}*/
/*font:last-child>br:only-child{display:none;}*/
/*p+div{display:none;}*/
/*p+div .child_br_last .div_br:last-child{display:none;}*/
/*for img*/
[data-uranus-layout="columnB"] [data-uranus-layout="mainInner"]{padding-right:0;}
img[width="1080"][height="589"]{

    height: 200px !important;
    object-fit: none;
    object-position: 50% 80%;

}
img[width="720"][height="422"]{height:200px;object-fit:cover;}
img[width="995"][height="1000"]{height:420px;object-fit:cover;object-position:50% 45%}