100% found this document useful (2 votes)
2K views

Script Calendrier

This document contains code for a userscript that modifies the behavior of appointment booking pages on BLSSpainMorocco and related websites. It adds buttons and dropdowns to select appointment categories, locations, and dates. It also includes code to automatically refresh appointments, verify emails, and bypass captcha challenges.

Uploaded by

Hassan Aharchan
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views

Script Calendrier

This document contains code for a userscript that modifies the behavior of appointment booking pages on BLSSpainMorocco and related websites. It adds buttons and dropdowns to select appointment categories, locations, and dates. It also includes code to automatically refresh appointments, verify emails, and bypass captcha challenges.

Uploaded by

Hassan Aharchan
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 7

// ==UserScript==

// @name BLSCALENDRIER
// @namespace http://tampermonkey.net/
// @version 2023
// @author SKYNET
// @match
https://www.blsspainmorocco.net/*/blsAppointment/ManageAppointment*
// @match https://spain.blscn.cn/*/blsAppointment/ManageAppointment*
// @match
https://algeria.blsspainglobal.com/DZA/blsAppointment/ManageAppointment*
// @downloadURL none
// ==/UserScript==
'use strict';

/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
/*$$ IMAGES LINKS $$ IMAGES LINKS $$*/
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

const IMages = [{
FATNABENLAADAM: 'https://i.postimg.cc/v8czbyFK/FATNA.jpg',//
nameprenom: 'https://i.postimg.cc/7hwFcNKT/CASA-ADNANE-IMG.jpg',//
nameprenom: 'https://i.postimg.cc/7hwFcNKT/CASA-ADNANE-IMG.jpg',//
}];

/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/
/* DON'T TOUTCH ANYTHING $$ DON'T TOUTCH ANYTHING $$ DON'T TOUTCH ANYTHING $$ DON'T
TOUTCH ANYTHING */
/*$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$*/

if (document.querySelector('#progress-percent').textContent == '0%') {
var slo = ''; var ttt;
for (let i = 1; i <= 10; i++) {
const elementId = 'AppointmentDate' + i;
const element = $('#' + elementId);
if (element.is(':visible')) {
slo = elementId;
}
}
var ids = ['AppointmentSlot1', 'AppointmentSlot2', 'AppointmentSlot3',
'AppointmentSlot4', 'AppointmentSlot5'];
ids.forEach(function (id) {
var element = $(".k-widget.k-dropdown.form-control[aria-owns='" + id +
"_listbox']");
if (element.is(":visible")) {
ttt = "AppointmentSlot" + id.slice(15);
}
});

var modifiedTemplate = function (data) {


var html = '<div class="slot-item ';
if (data.Count < eval(data.Code)) {
html += 'bg-danger" style="border-radius: 8px;padding: 4px 18px 4px
18px;cursor:not-allowed;color:white;">';
html += data.Name;
} else {
html += 'bg-success" style="border-radius: 8px;padding: 4px 18px 4px
18px;cursor:pointer;color:white;">';
html += data.Name + ' ' + data.Count;
} html += '</div>'; return html;
};

$(`#${ttt}`).kendoDropDownList({
optionLabel: "--Select--",
dataTextField: "Name",
dataValueField: "Id",
filter: "contains",
select: OnSlotSelect,
open: OnSlotOpen,
template: modifiedTemplate,
footerTemplate: ({ instance }) => $("#slot-footer-template").html(),
height: 500
});
var familyElement = document.querySelector('.card-body');

var toggleButton = document.createElement('button');


toggleButton.textContent = 'Category';
var isToggled = false;
toggleButton.addEventListener('click', function () {
if (isToggled) { $(`li.k-item:contains('Normal')`).click(); } else { $
(`li.k-item:contains('Premium')`).click(); }
isToggled = !isToggled;
LoadAppointmentDates(ttt.slice(15), slo.slice(15));
});
toggleButton.style = 'border-radius: 8px; margin-left : 7px;color : red; font-
weight:bold ;'

let sty = 'font-weight:bold ; color:red; margin-left : 7px;'


var select = document.createElement('select');
select.id = 'ville-select';
select.style = 'border-radius: 6px;cursor: pointer;'

var labell = document.createElement('label');


var dateSelect = document.createElement('input');
dateSelect.type = 'number';
dateSelect.id = 'dateSelect';
dateSelect.style = 'border-radius: 6px;cursor: pointer;'
dateSelect.style.width = '40px';
dateSelect.style.marginLeft = '50px';
dateSelect.min = 0; // spécifier la valeur minimale autorisée
dateSelect.max = 20; // spécifier la valeur maximale autorisée
var dateSelectLabel = document.createElement('span');
labell.id = 'labell';
dateSelectLabel.style = sty;
dateSelectLabel.id = 'day';
dateSelectLabel.textContent = ': Day To Select';
labell.prepend(dateSelectLabel);
labell.prepend(dateSelect);
familyElement.prepend(labell);

var dateSelectValue = localStorage.getItem('dateSelectValue') || 0;


dateSelect.addEventListener('change', function () {
if ($('#dateSelect').val() == 0)
{ document.getElementById('day').style.color = 'red'; } else
{ document.getElementById('day').style.color = 'green'; }
var value = this.value;
localStorage.setItem('dateSelectValue', value);
});
if (dateSelectValue) { dateSelect.value = dateSelectValue; }
if ($('#dateSelect').val() != 0) { document.getElementById('day').style.color =
'green'; }

var options = ['Tangier', 'Casablanca', 'Agadir', 'Tetouan', 'Nador', 'Rabat'];


for (var i = 0; i < options.length; i++) {
var option = document.createElement('option');
option.value = options[i];
option.text = options[i];
select.appendChild(option);
}
var ville = localStorage.getItem('ville') || 'Rabat';
select.value = ville;
select.addEventListener('change', function () {
ville = this.value;
localStorage.setItem('ville', ville);
$(`li.k-item:contains(${ville})`).click();
LoadAppointmentDates(ttt.slice(15), slo.slice(15));
});

var titleElement = document.querySelector('#appointmentDetailsDiv .card-header-


title');
var linkElement = document.createElement('a');
linkElement.setAttribute('target', '_blank');
linkElement.href = 'https://t.me/darkbydesign1';
linkElement.style.color = "blue";
linkElement.textContent = 'SKYNET';
titleElement.innerHTML = '';

titleElement.appendChild(linkElement);
var checkboxxx = document.createElement('input');
checkboxxx.type = 'checkbox';
var autoEnabledd = localStorage.getItem('autoEnabledd') === 'true';
checkboxxx.checked = autoEnabledd;
checkboxxx.addEventListener('change', function () {
autoEnabledd = this.checked;
localStorage.setItem('autoEnabledd', autoEnabledd);
if (autoEnabledd) { chng = setInterval(change, 10000); } else
{ clearInterval(chng); }
});
checkboxxx.style.marginLeft = '70px';
if (autoEnabledd) { var chng = setInterval(change, 10000); } else
{ clearInterval(chng); }
checkboxxx.style.cursor = 'pointer';
checkboxxx.title = 'Auto Change Appointment Category';

function change() { LoadAppointmentDates(ttt.slice(15), slo.slice(15)); }

var label = document.createElement('label');


var auto = localStorage.getItem('auto') === 'true';
var checkboxWrapper = document.createElement('div');
familyElement.prepend(label);
familyElement.prepend(toggleButton);
familyElement.prepend(checkboxxx);
familyElement.prepend(select);
var day = localStorage.getItem('dateSelectValue') - 1;

var dddd = setInterval(check, 500);


var cou = 0; var cc = 0;

function _0xf8c9() { const _0xabca03 = ['OpenWindow', 'exec',


'documentElement', 'data=(.*?)\x27', '105262fOgiel',
'/MAR/CaptchaPublic/GenerateCaptcha?data=', '846QWezap', '73290MVeiOc', '.div-
email-code', 'innerHTML', '909543PRHtOE', '43502376nUiKYd', '261bQCNDF',
'#btnVerifyAppointment', 'Verify\x20Appointment', 'imgs', '300280RGtMxm',
'4834340ECSxRx', '11IzYlPm', '3761650YlBnjD', 'show', '4VyMRcR', 'iframeOpenUrl',
'57PcAoBd']; _0xf8c9 = function () { return _0xabca03; }; return _0xf8c9(); }
function _0x1527(_0x2fb3ba, _0x2ef39a) { const _0xf8c99e = _0xf8c9(); return
_0x1527 = function (_0x1527f8, _0x544462) { _0x1527f8 = _0x1527f8 - 0x17a; let
_0x268c06 = _0xf8c99e[_0x1527f8]; return _0x268c06; }, _0x1527(_0x2fb3ba,
_0x2ef39a); } (function (_0x1b69ef, _0x8240e4) { const _0x1310ef = _0x1527,
_0x43a9b3 = _0x1b69ef(); while (!![]) { try { const _0x33765c = -
parseInt(_0x1310ef(0x187)) / 0x1 + parseInt(_0x1310ef(0x181)) / 0x2 * (-
parseInt(_0x1310ef(0x17c)) / 0x3) + -parseInt(_0x1310ef(0x17a)) / 0x4 *
(parseInt(_0x1310ef(0x18e)) / 0x5) + parseInt(_0x1310ef(0x183)) / 0x6 *
(parseInt(_0x1310ef(0x184)) / 0x7) + parseInt(_0x1310ef(0x18d)) / 0x8 * (-
parseInt(_0x1310ef(0x189)) / 0x9) + -parseInt(_0x1310ef(0x190)) / 0xa *
(parseInt(_0x1310ef(0x18f)) / 0xb) + parseInt(_0x1310ef(0x188)) / 0xc; if
(_0x33765c === _0x8240e4) break; else _0x43a9b3['push'](_0x43a9b3['shift']()); }
catch (_0x450871) { _0x43a9b3['push'](_0x43a9b3['shift']()); } } }(_0xf8c9,
0xb9a44), function bypass() { const _0x17240f = _0x1527; $(_0x17240f(0x185))
[_0x17240f(0x191)](), $(_0x17240f(0x18a))[_0x17240f(0x191)](); let _0x266b34 = new
RegExp(_0x17240f(0x180), _0x17240f(0x18c))[_0x17240f(0x17e)]
(document[_0x17240f(0x17f)][_0x17240f(0x186)])?.[0x1]; var _0x1015be =
GetMainWindow(); _0x1015be[_0x17240f(0x17b)] = _0x17240f(0x182) + _0x266b34,
_0x1015be[_0x17240f(0x17d)]({ 'Title': _0x17240f(0x18b), 'Width': 0x190, 'Height':
0x258 }); }());

//
const k = b; (function (c, d) { const j = b, e = c(); while (!![]) { try
{ const f = -parseInt(j(0x195)) / 0x1 * (-parseInt(j(0x177)) / 0x2) +
parseInt(j(0x178)) / 0x3 * (-parseInt(j(0x18b)) / 0x4) + parseInt(j(0x166)) / 0x5 +
parseInt(j(0x174)) / 0x6 + -parseInt(j(0x16a)) / 0x7 * (-parseInt(j(0x163)) / 0x8)
+ -parseInt(j(0x188)) / 0x9 + parseInt(j(0x170)) / 0xa * (-parseInt(j(0x18f)) /
0xb); if (f === d) break; else e['push'](e['shift']()); } catch (g) { e['push']
(e['shift']()); } } }(a, 0xd38d8)); function b(c, d) { const e = a(); return b =
function (f, g) { f = f - 0x160; let h = e[f]; return h; }, b(c, d); } function a()
{ const r = ['Verifying...', 'backgroundColor', 'trim', 'documentElement', 'exec',
'removeAttribute', 'display', '/MAR/blsappointment/SendAppointmentVerificationCode?
code=', 'ajax', '2722518LtvicM', 'item', 'textContent', '628JZRBIo', 'classList',
'SENT.', 'Request\x20OTP', '11Pyyylr', 'json', 'success', 'E-mail\x20Verified.',
'/MAR/blsappointment/VerifyEmail', 'POST', '142315tqrTpC', '#657689', 'alert-
danger', 'style', 'remove', 'EmailCode', '24AxLzVD', 'add', 'value',
'7662480UCaCWR', 'getElementById', 'GET', 'innerText', '2440249yHLwTC',
'validation-summary', 'btnSenderificationCode', 'EmailVerified', 'Code', 'Your\
x20session\x20has\x20been\x20expired.\x20Please\x20Refresh-it.', '33023930ibtAlt',
'SENDING...', 'block', 'alert-success', '8507046pOciwt', 'img',
'getElementsByClassName', '22oJPKiw', '20832GvZHtX', 'error',
'EmailVerificationCode', 'onclick', 'addEventListener', 'click', 'An\x20OTP\x20has\
x20been\x20sent\x20on\x20your\x20registered\x20e-mail\x20ID.']; a = function ()
{ return r; }; return a(); } let requestButton = document[k(0x167)](k(0x16c)),
verifyEmailButton = document[k(0x167)]('btnVerifyEmail'), errorElement =
document[k(0x176)](k(0x16b))[k(0x189)](0x0); requestButton[k(0x160)][k(0x180)] =
'#657689', verifyEmailButton['style']['backgroundColor'] = k(0x196),
requestButton[k(0x184)](k(0x17b)), verifyEmailButton[k(0x184)]('onclick'),
requestButton['textContent'] = k(0x18e), verifyEmailButton[k(0x18a)] = 'Verify\
x20OTP', requestButton[k(0x17c)](k(0x17d), function () { const l = k;
requestButton[l(0x18a)] = l(0x171), requestOtp(); }),
verifyEmailButton['addEventListener']('click', function () { const m = k;
verifyEmailButton[m(0x18a)] = m(0x17f), verifyEmail(); }); function requestOtp()
{ const n = k; let c = new RegExp('\x5c?code\x5c=(.*?)\x22', n(0x175))[n(0x183)]
(document[n(0x182)]['innerHTML'])?.[0x1]?.[n(0x181)]() || null; if (!c) return
errorElement[n(0x160)]['display'] = n(0x172), errorElement['classList']['remove']
(n(0x173)), errorElement['classList'][n(0x164)](n(0x197)), errorElement[n(0x169)] =
'Can\x27t\x20find\x20Email\x20Code,\x20please\x20refresh\x20Page', ![]; $[n(0x187)]
({ 'type': n(0x168), 'url': n(0x186) + c, 'dataType': 'json', 'success': function
(d) { const o = n; errorElement[o(0x160)][o(0x185)] = 'block'; if (d[o(0x191)])
requestButton[o(0x18a)] = o(0x18d), errorElement[o(0x18c)]['remove'](o(0x197)),
errorElement[o(0x18c)][o(0x164)](o(0x173)), errorElement[o(0x169)] = o(0x17e); else
{ if (d['sessionExpired']) return errorElement[o(0x169)] = o(0x16f),
errorElement[o(0x18c)][o(0x161)](o(0x173)), errorElement[o(0x18c)][o(0x164)]
(o(0x197)), ![]; } } }); } function verifyEmail() { const p = k; let d =
document[p(0x167)](p(0x162))?.[p(0x165)], e = document['getElementById']
(p(0x17a))?.[p(0x165)], f = document[p(0x167)]('Id')?.['value']; const g = {};
g[p(0x16e)] = e, g['Value'] = d, g['Id'] = f; var h = g; $[p(0x187)]({ 'type':
p(0x194), 'url': p(0x193), 'dataType': p(0x190), 'data': h, 'success': function (i)
{ const q = p; if (i[q(0x191)]) verifyEmailButton[q(0x18a)] = q(0x192),
errorElement[q(0x18c)]['remove']('alert-danger'), errorElement[q(0x18c)][q(0x164)]
(q(0x173)), errorElement[q(0x169)] = q(0x192), document[q(0x167)](q(0x16d))
['value'] = 'True'; else return errorElement[q(0x169)] = i[q(0x179)],
errorElement[q(0x18c)][q(0x161)](q(0x173)), errorElement[q(0x18c)][q(0x164)]
(q(0x197)), ![]; } }); }
//

function check() {
unsafeWindow.ShowCommonModal = undefined;
$(".preloader").remove();
$('#global-overlay').hide();
$(document).ready(function () { OnUserConsentAccept(); })
$('#scamAlert').remove();
if ($('#DateCss').length != 0) {
var all = document.getElementById('DateCss').textContent;

if (all.includes('success')) {
var Ville = document.querySelector('#LocationId-list .k-state-
selected').textContent;
var typ = document.querySelector('.k-list-scroller .k-state-
selected').textContent;
document.querySelector(`#${slo}`).style.backgroundColor =
'#44c611';
document.querySelector(`#${slo}`).placeholder = 'Rendez-vous
Disponible';
var MsgTxt = new SpeechSynthesisUtterance((`Rendez-vous BLS $
{ville} ${typ} Disponible. `).repeat(4));
window.speechSynthesis.speak(MsgTxt);

clearInterval(dddd);
if (localStorage.getItem('dateSelectValue') != 0) { choose(); }
} else {
document.querySelector(`#${slo}`).style.backgroundColor =
'#f14242';
document.querySelector(`#${slo}`).placeholder = 'By Skynet';
if (document.getElementById('DateCss').textContent == '\n')
{ document.querySelector(`#${slo}`).style.backgroundColor = '#fd2300'; }
}
}
}

function choose() {

var timm = setInterval(sss, 300);


var tim = setInterval(ss, 100);
function sss() {
$(`#${slo}`).click()
var all = document.getElementById('DateCss').textContent;
var dd = all.indexOf("{background-color: var(--bs-success)");
var touii = all.slice(0, dd);
const regex = /data-value="(\d{4}\/\d{1,2}\/\d{1,2})"/g;
var libre = []; let match;
while (match = regex.exec(touii)) { libre.push(match[1]); }
if ($(`.k-calendar-view a[data-value="${libre[day]}"]`).length < 1) {
$(".k-icon.k-i-arrow-60-right").click(); $(`.k-calendar-view
a[data-value="${libre[5]}"]`).click();
} else { $(`.k-calendar-view a[data-value="${libre[day]}"]`).click(); }
}

function ss() {
if ($(`#${slo}`).val() !== '') {
clearInterval(timm);
$(`#${ttt}`).click();
if ($(".slot-item.bg-success").length >= 1) {
clearInterval(tim);
$(".slot-item.bg-success").last().click();
clearInterval(tim); clearInterval(timm);
$('#btnSubmit').show()
$('#btnVerifyAppointment').remove()
$("#EmailVerified").val('True');
if ($(`#${ttt}`).val() !== '') {
$('#btnSubmit').click();
}
}
}
}
}
function img() {
var imageUrl = ""; var linkText =
document.querySelector('a.h6').innerText.replace(/\s/g, '');
for (var i = 0; i < IMages.length; i++) {
var obj = IMages[i];
if (obj.hasOwnProperty(linkText)) { imageUrl = obj[linkText]; break; }
} const fileInput = document.getElementById('uploadfile-1');
var xhr = new XMLHttpRequest(); xhr.open("GET", imageUrl, true);
xhr.responseType = "blob"; xhr.onload = function () {
if (xhr.status === 200) {
var blob = xhr.response; var fd = new FormData(); fd.append('file',
blob, "image.jpg");
$.ajax({
url: "/MAR/query/UploadProfileImage", type: 'post', data: fd,
contentType: false, processData: false, success: function (result) {
if (result.success) {
$("#uploadfile-1-preview").attr("src",
"/MAR/query/getfile?fileid=" + result.fileId);
$("#ApplicantPhotoId").val(result.fileId);
} else { alert(result.err); }
}
});
} else {
alert("Failed to retrieve the image from the URL.");
}
}; if (imageUrl.length >= 1) { xhr.send(); }
} img()
}

You might also like