nishino_ameblo_easy
by
jigendaddy
2019-02-28 [2019/02/28 10:43:44]
try to take over the world!
@@ -1,5 +1,4 @@
// ==UserScript==
-// @title nishino_ameblo_easy
// @name nishino_ameblo_easy
// @namespace http://tampermonkey.net/
// @version 0.1
@@ -10,122 +9,127 @@
// @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) and not(self::font)]', 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) and not(self::font)]', 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"]//*[self::div or self::span]/text()', document, null, 7, null);
-for (var x = 0; x < result4.snapshotLength; x++) {
- if (/^\s+/g.test(result4.snapshotItem(x).nodeValue)) {
- if (!(/ /g.test(result4.snapshotItem(x).nodeValue))) {
- result4.snapshotItem(x).nodeValue = result4.snapshotItem(x).nodeValue.replace(/^\s+/g, "");
- }
- }
-}
-var result5 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[self::div or self::span][contains(text()," ")]', document, null, 7, null);
-for (var y = 0; y < result5.snapshotLength; y++) {
- result5.snapshotItem(y).classList.add("div_br");
-}
-var listArray4 = document.querySelectorAll('.skin-entryBody>div:empty');
-for (var z = 0; z < listArray4.length; z++) {
- listArray4[z].remove();
-}
-var listArray5 = document.querySelectorAll('.entry-text>span[lang]');
-for (var e = 0; e < listArray5.length; e++) {
- listArray5[e].remove();
-}
-var listArray6 = document.querySelectorAll('.skin-entryBody>span.div_br[style]');
-for (var p = 0; p < listArray6.length; p++) {
- listArray6[p].classList.remove("div_br");
-}
-//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");
-}
-//a/img処理
-var result20 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//a[./img or ./amp-img]/ancestor::*[not(self::td)][./ancestor::div[@class="skin-entryBody" or @class="entry-text"]]', document, null, 7, null);
-for (var w = 0; w < result20.snapshotLength; w++) {
- result20.snapshotItem(w).classList.add("anc_img");
-}
-$('.anc_img').contents().unwrap();
-var result15 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/a[./img or ./amp-img]', document, null, 7, null);
-for (var g = 0; g < result15.snapshotLength; g++) {
- result15.snapshotItem(g).classList.add("a_img");
-}
-//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>");
-}
-//fbi処理
-var listArray7 = document.querySelectorAll('.skin-entryBody b,.skin-entryBody i,.skin-entryBody font');
-for (var q = 0; q < listArray7.length; q++) {
- listArray7[q].classList.add("fbi");
-}
-var listArray9 = document.querySelectorAll('.skin-entryBody font[size="2"]');
-for (var m = 0; m < listArray9.length; m++) {
- listArray9[m].classList.remove("fbi");
- listArray9[m].classList.add("f_size");
-}
-$('.fbi').wrap("<span class='s_fbi'></span>");
-$('.fbi').contents().unwrap();
-var result17 = document.evaluate('//span[@class="s_fbi"][./span[@class="s_fbi"]]', document, null, 7, null);
-for (var t = 0; t < result17.snapshotLength; t++) {
- result17.snapshotItem(t).classList.add("anc_fbi");
-}
-$('.anc_fbi').contents().unwrap();
-var result18 = document.evaluate('//*[@class="s_fbi" or @class="f_size"][./br[not(./preceding-sibling::* or ./following-sibling::*)]]', document, null, 7, null);
-for (var u = 0; u < result18.snapshotLength; u++) {
- result18.snapshotItem(u).remove();
-}
-var result19 = document.evaluate('//a[./font[@class="f_size"]]', document, null, 7, null);
-for (var v = 0; v < result19.snapshotLength; v++) {
- result19.snapshotItem(v).classList.add("hide_block");
-}
-$('.s_fbi>.hide_block').parent().contents().unwrap();
-$(".hide_block+br").wrap("<div class='div_br'></div>");
-//横線があればblock要素にする為クラス付加
-var result16 = document.evaluate('//span[@class="s_fbi"][contains(text(),"━")]', document, null, 7, null);
-for (var h = 0; h < result16.snapshotLength; h++) {
- result16.snapshotItem(h).classList.add("s_yoko");
-}
var listArray8 = document.querySelectorAll('.skin-entryBody *[style]');
for (var r = 0; r < listArray8.length; r++) {
listArray8[r].removeAttribute("style");
}
-var listArray10 = document.querySelectorAll('.skin-entryBody font[color]');
+var listArray10 = document.querySelectorAll('.skin-entryBody font[color],.skin-entryBody font[face]');
for (var s = 0; s < listArray10.length; s++) {
- listArray10[s].removeAttribute("color");
-}
-//生テキスト処理
-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");
+ listArray10[s].removeAttribute("color");
+ listArray10[s].removeAttribute("face");
}
-//first_text処理
-var result10 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/*[1]/preceding-sibling::text()[string-length()>1]', document, null, 7, null);
-var result11 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]', document, null, 7, null);
-result11.snapshotItem(0).insertAdjacentHTML("afterbegin", "<span class='fs'>" + result10.snapshotItem(0).nodeValue + "</span>");
-result10.snapshotItem(0).nodeValue = "";
+var result6 = document.evaluate('//div[@class="skin-entryBody"]/descendant::span[./following-sibling::span][1]', document, null, 7, null);
+result6.snapshotItem(0).id = "c_span";
+if (document.getElementById("c_span") == null) {
+ 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) and not(self::font)]', 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) and not(self::font)]', 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"]//*[self::div or self::span]/text()', document, null, 7, null);
+ for (var x = 0; x < result4.snapshotLength; x++) {
+ if (/^\s+/g.test(result4.snapshotItem(x).nodeValue)) {
+ if (!(/ /g.test(result4.snapshotItem(x).nodeValue))) {
+ result4.snapshotItem(x).nodeValue = result4.snapshotItem(x).nodeValue.replace(/^\s+/g, "");
+ }
+ }
+ }
+ var result5 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[self::div or self::span][contains(text()," ")]', document, null, 7, null);
+ for (var y = 0; y < result5.snapshotLength; y++) {
+ result5.snapshotItem(y).classList.add("div_br");
+ }
+ var listArray4 = document.querySelectorAll('.skin-entryBody>div:empty');
+ for (var z = 0; z < listArray4.length; z++) {
+ listArray4[z].remove();
+ }
+ var listArray5 = document.querySelectorAll('.entry-text>span[lang]');
+ for (var e = 0; e < listArray5.length; e++) {
+ listArray5[e].remove();
+ }
+ var listArray6 = document.querySelectorAll('.skin-entryBody>span.div_br[style]');
+ for (var p = 0; p < listArray6.length; p++) {
+ listArray6[p].classList.remove("div_br");
+ }
+ //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");
+ }
+ //a/img処理
+ var result20 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//a[./img or ./amp-img]/ancestor::*[not(self::td)][./ancestor::div[@class="skin-entryBody" or @class="entry-text"]]', document, null, 7, null);
+ for (var w = 0; w < result20.snapshotLength; w++) {
+ result20.snapshotItem(w).classList.add("anc_img");
+ }
+ $('.anc_img').contents().unwrap();
+ var result15 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/a[./img or ./amp-img]', document, null, 7, null);
+ for (var g = 0; g < result15.snapshotLength; g++) {
+ result15.snapshotItem(g).classList.add("a_img");
+ }
+ //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>");
+ }
+ //fbi処理
+ var listArray7 = document.querySelectorAll('.skin-entryBody b,.skin-entryBody i,.skin-entryBody font');
+ for (var q = 0; q < listArray7.length; q++) {
+ listArray7[q].classList.add("fbi");
+ }
+ var listArray9 = document.querySelectorAll('.skin-entryBody font[size="2"]');
+ for (var m = 0; m < listArray9.length; m++) {
+ listArray9[m].classList.remove("fbi");
+ listArray9[m].classList.add("f_size");
+ }
+ $('.fbi').wrap("<span class='s_fbi'></span>");
+ $('.fbi').contents().unwrap();
+ var result17 = document.evaluate('//span[@class="s_fbi"][./span[@class="s_fbi"]]', document, null, 7, null);
+ for (var t = 0; t < result17.snapshotLength; t++) {
+ result17.snapshotItem(t).classList.add("anc_fbi");
+ }
+ $('.anc_fbi').contents().unwrap();
+ var result18 = document.evaluate('//*[@class="s_fbi" or @class="f_size"][./br[not(./preceding-sibling::* or ./following-sibling::*)]]', document, null, 7, null);
+ for (var u = 0; u < result18.snapshotLength; u++) {
+ result18.snapshotItem(u).remove();
+ }
+ var result19 = document.evaluate('//a[./font[@class="f_size"]]', document, null, 7, null);
+ for (var v = 0; v < result19.snapshotLength; v++) {
+ result19.snapshotItem(v).classList.add("hide_block");
+ }
+ $('.s_fbi>.hide_block').parent().contents().unwrap();
+ $(".hide_block+br").wrap("<div class='div_br'></div>");
+ //横線があればblock要素にする為クラス付加
+ var result16 = document.evaluate('//span[@class="s_fbi"][contains(text(),"━")]', document, null, 7, null);
+ for (var h = 0; h < result16.snapshotLength; h++) {
+ result16.snapshotItem(h).classList.add("s_yoko");
+ }
+ //生テキスト処理
+ 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");
+ }
+ //first_text処理
+ var result10 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/*[1]/preceding-sibling::text()[string-length()>1]', document, null, 7, null);
+ var result11 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]', document, null, 7, null);
+ result11.snapshotItem(0).insertAdjacentHTML("afterbegin", "<span class='fs'>" + result10.snapshotItem(0).nodeValue + "</span>");
+ result10.snapshotItem(0).nodeValue = "";
+}
// ==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 listArray8 = document.querySelectorAll('.skin-entryBody *[style]');
for (var r = 0; r < listArray8.length; r++) {
listArray8[r].removeAttribute("style");
}
var listArray10 = document.querySelectorAll('.skin-entryBody font[color],.skin-entryBody font[face]');
for (var s = 0; s < listArray10.length; s++) {
listArray10[s].removeAttribute("color");
listArray10[s].removeAttribute("face");
}
var result6 = document.evaluate('//div[@class="skin-entryBody"]/descendant::span[./following-sibling::span][1]', document, null, 7, null);
result6.snapshotItem(0).id = "c_span";
if (document.getElementById("c_span") == null) {
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) and not(self::font)]', 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) and not(self::font)]', 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"]//*[self::div or self::span]/text()', document, null, 7, null);
for (var x = 0; x < result4.snapshotLength; x++) {
if (/^\s+/g.test(result4.snapshotItem(x).nodeValue)) {
if (!(/ /g.test(result4.snapshotItem(x).nodeValue))) {
result4.snapshotItem(x).nodeValue = result4.snapshotItem(x).nodeValue.replace(/^\s+/g, "");
}
}
}
var result5 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//*[self::div or self::span][contains(text()," ")]', document, null, 7, null);
for (var y = 0; y < result5.snapshotLength; y++) {
result5.snapshotItem(y).classList.add("div_br");
}
var listArray4 = document.querySelectorAll('.skin-entryBody>div:empty');
for (var z = 0; z < listArray4.length; z++) {
listArray4[z].remove();
}
var listArray5 = document.querySelectorAll('.entry-text>span[lang]');
for (var e = 0; e < listArray5.length; e++) {
listArray5[e].remove();
}
var listArray6 = document.querySelectorAll('.skin-entryBody>span.div_br[style]');
for (var p = 0; p < listArray6.length; p++) {
listArray6[p].classList.remove("div_br");
}
//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");
}
//a/img処理
var result20 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]//a[./img or ./amp-img]/ancestor::*[not(self::td)][./ancestor::div[@class="skin-entryBody" or @class="entry-text"]]', document, null, 7, null);
for (var w = 0; w < result20.snapshotLength; w++) {
result20.snapshotItem(w).classList.add("anc_img");
}
$('.anc_img').contents().unwrap();
var result15 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/a[./img or ./amp-img]', document, null, 7, null);
for (var g = 0; g < result15.snapshotLength; g++) {
result15.snapshotItem(g).classList.add("a_img");
}
//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>");
}
//fbi処理
var listArray7 = document.querySelectorAll('.skin-entryBody b,.skin-entryBody i,.skin-entryBody font');
for (var q = 0; q < listArray7.length; q++) {
listArray7[q].classList.add("fbi");
}
var listArray9 = document.querySelectorAll('.skin-entryBody font[size="2"]');
for (var m = 0; m < listArray9.length; m++) {
listArray9[m].classList.remove("fbi");
listArray9[m].classList.add("f_size");
}
$('.fbi').wrap("<span class='s_fbi'></span>");
$('.fbi').contents().unwrap();
var result17 = document.evaluate('//span[@class="s_fbi"][./span[@class="s_fbi"]]', document, null, 7, null);
for (var t = 0; t < result17.snapshotLength; t++) {
result17.snapshotItem(t).classList.add("anc_fbi");
}
$('.anc_fbi').contents().unwrap();
var result18 = document.evaluate('//*[@class="s_fbi" or @class="f_size"][./br[not(./preceding-sibling::* or ./following-sibling::*)]]', document, null, 7, null);
for (var u = 0; u < result18.snapshotLength; u++) {
result18.snapshotItem(u).remove();
}
var result19 = document.evaluate('//a[./font[@class="f_size"]]', document, null, 7, null);
for (var v = 0; v < result19.snapshotLength; v++) {
result19.snapshotItem(v).classList.add("hide_block");
}
$('.s_fbi>.hide_block').parent().contents().unwrap();
$(".hide_block+br").wrap("<div class='div_br'></div>");
//横線があればblock要素にする為クラス付加
var result16 = document.evaluate('//span[@class="s_fbi"][contains(text(),"━")]', document, null, 7, null);
for (var h = 0; h < result16.snapshotLength; h++) {
result16.snapshotItem(h).classList.add("s_yoko");
}
//生テキスト処理
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");
}
//first_text処理
var result10 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]/*[1]/preceding-sibling::text()[string-length()>1]', document, null, 7, null);
var result11 = document.evaluate('//div[@class="skin-entryBody" or @class="entry-text"]', document, null, 7, null);
result11.snapshotItem(0).insertAdjacentHTML("afterbegin", "<span class='fs'>" + result10.snapshotItem(0).nodeValue + "</span>");
result10.snapshotItem(0).nodeValue = "";
}
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。