自動填寫姓名、電話跟email

This commit is contained in:
2024-06-26 09:14:24 +00:00
parent eae1847ac5
commit d840aa1f70

View File

@@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name pokemon_cafe_script // @name pokemon_cafe_script
// @namespace https://git.moonjuice.tw/moonjuice/pokemon_script // @namespace https://git.moonjuice.tw/moonjuice/pokemon_script
// @version 2024-03-07 // @version 2024-06-26
// @description try to take over the world! // @description try to take over the world!
// @author moonjuice // @author moonjuice
// @match https://reserve.pokemon-cafe.jp/* // @match https://reserve.pokemon-cafe.jp/*
@@ -72,6 +72,10 @@
}*/ }*/
console.log(GM_getValue('seat')); console.log(GM_getValue('seat'));
console.log(GM_getValue('seatId')); console.log(GM_getValue('seatId'));
$('input[name=name]')[0].value='name';
$('input[name=name_kana]')[0].value='name';
$('input[name=phone_number]')[0].value='phone';
$('input[name=email]')[0].value='email';
} }
})(); })();
@@ -102,10 +106,10 @@ function chooseSeat() {
seatId = $('.post-link')[0].getAttribute('data-seat-id'); seatId = $('.post-link')[0].getAttribute('data-seat-id');
} }
} else { // osaka => A seat first } else { // osaka => A seat first
var seats_1350 = Array.from($('.post-link')).filter((element) => element.text.includes('13:50')); //var seats_1350 = Array.from($('.post-link')).filter((element) => element.text.includes('13:50'));
/*if (seats_1350.length > 0) { /*if (seats_1350.length > 0) {
GM_setValue('seat', seats_1350[0].text); GM_setValue('seat', seats_1350[0].text);
seatId = seats_1350[0].getAttribute('data-seat-id'); seatId = seats_1350[0].getAttribute('data-seat-id');
} else*/ if (a_seats.length > 0) { } else*/ if (a_seats.length > 0) {
GM_setValue('seat', a_seats[0].text); GM_setValue('seat', a_seats[0].text);
seatId = a_seats[0].getAttribute('data-seat-id'); seatId = a_seats[0].getAttribute('data-seat-id');