Last active
November 5, 2019 23:01
-
-
Save iwbjp/f253d057448ee7264565934c89120472 to your computer and use it in GitHub Desktop.
NHKから国民を守る党の衆院選候補者ページに時間、年齢、身長、サイズをランダムで入れる
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
// NHKから国民を守る党の衆院選候補者ページに時間、年齢、身長、サイズをランダムで入れる | |
// https://www.nhkkara.jp/%E8%A1%86%E9%99%A2%E9%81%B8%E7%89%B9%E8%A8%AD%E3%83%9A%E3%83%BC%E3%82%B8/ | |
var k = $$('section ._2CtTI .jy5EN') | |
var h = $$('section ._2CtTI h3') | |
var n = $$('section ._2CtTI h3 + p') | |
var l = $$('section ._2CtTI .jy5EN > div > div:last-child') | |
k[7].style.display = 'none' | |
k[12].style.display = 'none' | |
k[13].style.display = 'none' | |
h.forEach(v => v.style.display = 'none') | |
var m = n.map(v => { | |
var a = Math.floor(Math.random() * 10) + 20 | |
var t1 = Math.floor(Math.random() * 14) + 10 | |
var t2 = Math.floor(Math.random() * 14) + 10 | |
if (t2 - t1 === 1) t2 += 2 | |
if (t1 === t2) t2 = 24 | |
if (t1 > t2) { | |
var _t = t1 | |
t1 = t2 | |
t2 = _t | |
} | |
var tt = `🕙${t1}:00〜${t2}:00` | |
var t = Math.floor(Math.random() * 20) + 148 | |
var b = Math.floor(Math.random() * 10) + 82 | |
var s = b > 88 ? 'E' : b > 86 ? 'D' : b > 84 ? 'C' : b > 80 ? 'B' : 'A' | |
var w = Math.floor(Math.random() * 5) + 55 | |
var h = Math.floor(Math.random() * 8) + 82 | |
return `<div style="font-size: 18px; margin-top: 5px;">${tt}</div> | |
${v.textContent.split(' ')[1]}(${a}歳)<br> | |
T${t}・${b}(${s})・${w}・${h}` | |
}) | |
l.forEach((v, i) => v.innerHTML = m[i]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment