ブックマークレット
Last active
April 4, 2020 04:43
-
-
Save vipzero/634635bfcf31da73745dda5a87276ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (() => { | |
document.querySelectorAll('.post').forEach((e) => { | |
const resNum = e.getElementsByClassName('number')[0].innerText; | |
const mes = e.getElementsByClassName('message')[0]; | |
const match = mes.innerText | |
.split('\n') | |
.map((line) => /^.*\d+( .+\/.+){6}$/.exec(line)) | |
.filter(Boolean); | |
if (!match || !match[0] || !match[0][0]) return; | |
const table = document.createElement('table'); | |
table.setAttribute('border', '1'); | |
const tr = document.createElement('tr'); | |
['5' + 'ch', '-' + resNum] | |
.concat(match[0][0].split(/ |\//g)) | |
.forEach((c) => { | |
const td = document.createElement('td'); | |
td.appendChild(document.createTextNode(c)); | |
tr.appendChild(td); | |
}); | |
table.appendChild(tr); | |
mes.appendChild(table); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment