nishino_ameblo_easy
by
jigendaddy
2019-02-28 [2019/02/28 10:43:44]
try to take over the world!
@@ -9,42 +9,48 @@
// @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) and not(self::font) and not(self::b)]',document, null, 7, null);
+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) and not(self::font) and not(self::b) and not(self::i)]',document, null, 7, null);
+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();
});
-$(".skin-entryBody>b+i").wrap("<div class='wrap'></div>");
-$(".skin-entryBody>i+b").wrap("<div class='wrap'></div>");
-var listArray = document.querySelectorAll('.skin-entryBody>font+br');
+$(".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("beforebegin", "<div></div>");
+ listArray[a].insertAdjacentHTML("afterend", "<div></div>");
}
-var listArray2 = document.querySelectorAll('.skin-entryBody>iframe+font');
+//改行処理
+var listArray2 = document.querySelectorAll('.skin-entryBody>a+iframe');
for (var b = 0; b < listArray2.length; b++) {
- listArray2[b].insertAdjacentHTML("beforebegin", "<div></div>");
+ listArray2[b].insertAdjacentHTML("beforebegin", "<div></div>");
}
-var listArray3 = document.querySelectorAll('.skin-entryBody>i+br');
+var listArray3 = document.querySelectorAll('.skin-entryBody>font+td');
for (var c = 0; c < listArray3.length; c++) {
- listArray3[c].insertAdjacentHTML("beforebegin", "<div></div>");
-}
-var listArray4 = document.querySelectorAll('.skin-entryBody>a+br+br');
-for (var x = 0; x < listArray4.length; x++) {
- listArray4[x].insertAdjacentHTML("beforebegin", "<div></div>");
-}
-var listArray5 = document.querySelectorAll('.skin-entryBody>b+br');
-for (var y = 0; y < listArray4.length; y++) {
- listArray5[y].insertAdjacentHTML("beforebegin", "<div></div>");
-}
-var listArray6 = document.querySelectorAll('.skin-entryBody>iframe+br');
-for (var z = 0; z < listArray6.length; z++) {
- listArray6[z].insertAdjacentHTML("beforebegin", "<div></div>");
-}
-$(".wrap").prev().addClass("wrap_prev1");
-$(".wrap_prev1").prev().addClass("wrap_prev2");
+ listArray3[c].insertAdjacentHTML("beforebegin", "<div></div>");
+}
// ==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();
});
$(".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>font+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 です。