1300

移行用のテストです

西野ブログ対策簡易版

このスクリプトは実験的なスクリプトです。デザイン上必要な改行やテキストなどが消える場合がありますのでご注意ください
http://let.hatelabo.jp/jigendaddy/let/hJmd3Lyj06tJ.js

// ==UserScript==
// @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/*
// @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 result = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//br/ancestor::*[./ancestor::div[@class="skin-entryBody" or @class="entry-text"] 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" or @class="entry-text"]//*[./text()]/ancestor::*[./ancestor::div[@class="skin-entryBody" or @class="entry-text"] 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)) {
    result4.snapshotItem(x).nodeValue = result4.snapshotItem(x).nodeValue.replace(/\s\s+/g, "");
    if (result4.snapshotItem(x).nodeValue.length < 2) {
      result5.snapshotItem(x).remove();
    }
  }
}
var result6 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[not(./node())][not(self::br) and  not(self::img) and  not(self::iframe) and not(self::amp-img) and not(self::i-amphtml-sizer)]|//div[@class="skin-entryBody" or @class="entry-text"]//*[not(./node())][not(self::br) and  not(self::img) and  not(self::iframe) and not(self::amp-img)]/ancestor::*[./ancestor::div[@class="skin-entryBody" or @class="entry-text"] 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>");
$(".entry-text>br").wrap("<div class='div_br'></div>");
var result3 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/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();
}
//生テキスト処理
var result14 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/text()[string-length()>1]/following-sibling::*[1][@class="div_br"]', document, null, 7, null);
for (var f = 0; f < result14.snapshotLength; f++) {
  result14.snapshotItem(f).classList.add("br_first");
}
//a/img処理
var result15 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/a[./img]', document, null, 7, null);
for (var g = 0; g < result15.snapshotLength; g++) {
  result15.snapshotItem(g).style.display = 'block';
}
//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>iframe');
for (var b = 0; b < listArray2.length; b++) {
  listArray2[b].insertAdjacentHTML("beforebegin", "<div></div>");
  listArray2[b].insertAdjacentHTML("afterend", "<div></div>");
}
var listArray3 = document.querySelectorAll('.skin-entryBody>td');
for (var c = 0; c < listArray3.length; c++) {
  listArray3[c].insertAdjacentHTML("beforebegin", "<div></div>");
}

http://scratchpad.io/smoggy-wound-6709

@-moz-document url-prefix("https://ameblo.jp/nishino-akihiro/"), url-prefix("https://gamp.ameblo.jp/nishino-akihiro/") {
.skin-entryBody{margin:0;}
.skin-entryBody *{margin:0 !important;
font-size:1em !important;}
.skin-entryBody h2{font-size:1.5em !important;}

.js-blogGenreRank{display:none;}
.skin-entryHead{margin:0;}
.skin-entryThemes{margin:0;}
.hashtag-module-wrapper{display:none;}

.skin-blogMainInner{padding:0 !important;}
/*for gamp*/
.entry amp-img[src*="/user_images/"][layout="responsive"] {margin:0;}
article{padding:0 !important;}
article+div{display:none;}
article>div:first-child{margin:0;}
.entry-header__title{margin:0;}

.div_br+.div_br{display:none;}
.skin-entryBody>.div_br{line-height:1;}
.div_last~.div_br{display:none;}
.div_yoko+br{display:none;}
br.wrap_prev2{display:none;}

/*for td*/
td{float:left;}
.td_after+div{clear:both;}

/*for fbi*/
.skin-entryBody>b+i::before,.skin-entryBody>i+b::before{
	content: "\A" ;
	white-space: pre ;
}

/*for text*/
.div_br+.br_first{display:block;}
/*for img*/
img[width="995"][height="1000"]{height:340px;object-fit:cover;object-position:50% 45%;}
}