Last active
August 12, 2021 08:10
-
-
Save harapeko/58e657c5e64b4b962ea874072f82621e 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
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) | |
const add = (date, days) => new Date(date).setDate(new Date(date).getDate() + days) | |
const today = new Intl.DateTimeFormat().format(new Date()) | |
firsts = [...Array(40).keys()].map(n => new Intl.DateTimeFormat('ja-JP', { | |
year: 'numeric', | |
month: '2-digit', | |
day: '2-digit' | |
}).format(add(today, n))) | |
$('#btn_Search_Medical').click() | |
firsts.forEach((day, index) => { | |
setTimeout(async () => { | |
document.getElementById('date_limit').value = day | |
document.getElementById('btn_search_medical').click() | |
await sleep(1000) | |
if (+document.getElementById('count_all').textContent.replace('件', '') > 0) console.log(day) | |
}, index * 1000) | |
}) |
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:sleep=e=>new Promise(t=>setTimeout(t,e)),add=(e,t)=>new Date(e).setDate(new Date(e).getDate()+t),today=(new Intl.DateTimeFormat).format(new Date);firsts=[...Array(40).keys()].map(e=>new Intl.DateTimeFormat("ja-JP",{year:"numeric",month:"2-digit",day:"2-digit"}).format(add(today,e))),$("#btn_Search_Medical").click(),firsts.forEach((e,t)=>{setTimeout(async()=>{document.getElementById("date_limit").value=e,document.getElementById("btn_search_medical").click(),await sleep(1e3),+document.getElementById("count_all").textContent.replace("件","")>0&&console.log(e)},1e3*t)}); |
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
document.getElementById('VisitnoAuthName').value= | |
document.getElementById('VisitnoAuthVisitno').value= | |
document.getElementById('VisitnoAuthYear').value = | |
document.getElementById('VisitnoAuthMonthMonth').value = | |
document.getElementById('VisitnoAuthDayDay').value = | |
document.querySelector('button[type="submit"]').click() |
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.getElementById('VisitnoAuthName').value=;document.getElementById('VisitnoAuthVisitno').value=;document.getElementById('VisitnoAuthYear').value =;document.getElementById('VisitnoAuthMonthMonth').value=;document.getElementById('VisitnoAuthDayDay').value=;document.querySelector('button[type="submit"]').click(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment