Skip to content

Instantly share code, notes, and snippets.

@vipzero
Last active April 4, 2020 04:43
Show Gist options
  • Save vipzero/634635bfcf31da73745dda5a87276ff3 to your computer and use it in GitHub Desktop.
Save vipzero/634635bfcf31da73745dda5a87276ff3 to your computer and use it in GitHub Desktop.
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