0% found this document useful (0 votes)
45 views4 pages

Note Hunter1.5

note hunter 1.5

Uploaded by

mahiaoui.ismail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views4 pages

Note Hunter1.5

note hunter 1.5

Uploaded by

mahiaoui.ismail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

// ==UserScript==

// @name TerminTracker Hunter v1.7


// @namespace http://tampermonkey.net/
// @version 1.655
// @description Script pour surveiller les créneaux de rendez-vous sur TLS en
fonction des critères définis
// @author T.T. Hunter
// @match https://www.termin-tracker-all.com/*
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Objet contenant les informations des centres


const centerInfo = {
'TlsGermanyRabat_FamilyVisit': { 'code': 'maRBA2de', 'country': 'de',
'aptType': 'court_sejour', 'issueCountry': 'ma' },
'TlsGermanyRabat_Tourism': { 'code': 'maRBA2de', 'country': 'de',
'aptType': 'tourism', 'issueCountry': 'ma' },
'TlsFranceFes_Case1': { 'code': 'eee2fr', 'country': 'fr', 'aptType':
'Preemo', 'issueCountry': 'ma' },
'TlsFranceFes_Case2': { 'code': 'maFEZ2fr', 'country': 'fr', 'aptType':
'Renouvellement', 'issueCountry': 'ma' },
'TlsFranceOujda_Case1': { 'code': 'maOUD2fr', 'country': 'fr', 'aptType':
'Primo', 'issueCountry': 'fa' },
'TlsFranceOujda_Case2': { 'code': 'maOUD2fr', 'country': 'fr', 'aptType':
'Renouvellement', 'issueCountry': 'ma' },
'TlsFranceCasablanca_Case1': { 'code': 'mrffeS2fr', 'country': 'fr',
'aptType': 'Grand%20Public%20PRIMO', 'issueCountry': 'ma' },
'TlsFranceCasablanca_Case2': { 'code': 'maCrf2fr', 'country': 'fr',
'aptType': 'Grand%20Public%20VISE', 'issueCountry': 'ma' },
'TlsFranceCasablanca_Case3': { 'code': 'maCf2fr', 'country': 'fr',
'aptType': 'Grand%20Public%20CIRCULATION', 'issueCountry': 'ma' },
'TlsFranceTanger_Case1': { 'code': 'maTNG2fr', 'country': 'fr', 'aptType':
'PRIMO', 'issueCountry': 'ma' },
'TlsFranceAgadir_Case1': { 'code': 'maAGA2fr', 'country': 'fr', 'aptType':
'Grand%20Public%20PRIMO', 'issueCountry': 'ma' },
'TlsFranceMarrakech_Case1': { 'code': 'maRAK2fr', 'country': 'fr',
'aptType': 'Grand%20Public%20PRIMO', 'issueCountry': 'ma' },
'TlsFranceMarrakech_Case2': { 'code': 'maRAK2fr', 'country': 'fr',
'aptType': 'Grand%20Public%20VISE', 'issueCountry': 'ma' },
'TlsFranceRabat_Case1': { 'code': 'maRBA2fr', 'country': 'fr', 'aptType':
'Primo', 'issueCountry': 'ma' },
'TlsFranceRabat_Case2': { 'code': 'maRBA2fr', 'country': 'fr', 'aptType':
'Renouvellement', 'issueCountry': 'ma' },
'TlsFranceAnnaba_Case1': { 'code': 'dzAAE2fr', 'country': 'fr', 'aptType':
'premiere_demande', 'issueCountry': 'dz' },
'TlsFranceAnnaba_Case2': { 'code': 'dzAAE2fr', 'country': 'fr', 'aptType':
'Frequent', 'issueCountry': 'dz' },
'TlsFranceAnnaba_Case3': { 'code': 'dzAAE2fr', 'country': 'fr', 'aptType':
'Circulation', 'issueCountry': 'dz' },
};

let inj_html = `
<div id="textHunterTitle">TerminTracker| Hunter <span style="font-size:
14px;">v1.7</span></div>
<div id="ttHunterDiv">
<form id="ttHunterForm">
<select id="itemHunterList" name="centHunterList">
<option value="TlsFranceCasablanca_Case1">TLS France à Casablanca (cas
1)/MA</option>
<option value="TlsFranceCasablanca_Case2">TLS France à Casablanca (cas
2)/MA</option>
<option value="TlsFranceCasablanca_Case3">TLS France à Casablanca (cas
3)/MA</option>
<option value="TlsFranceRabat_Case1">TLS France à Rabat (cas
1)/MA</option>
<option value="TlsFranceRabat_Case2">TLS France à Rabat (cas
2)/MA</option>
<option value="TlsFranceFes_Case1">TLS France à Fès (cas 1)/MA</option>
<option value="TlsFranceFes_Case2">TLS France à Fès (cas 2)/MA</option>
<option value="TlsFranceOujda_Case1">TLS France à Oujda (cas
1)/MA</option>
<option value="TlsFranceOujda_Case2">TLS France à Oujda (cas
2)/MA</option>
<option value="TlsFranceTanger_Case1">TLS France à Tanger (cas
1)/MA</option>
<option value="TlsFranceAgadir_Case1">TLS France à Agadir (cas
1)/MA</option>
<option value="TlsFranceMarrakech_Case1">TLS France à Marrakech (cas
1)/MA</option>
<option value="TlsFranceMarrakech_Case2">TLS France à Marrakech (cas
2)/MA</option>
<option value="TlsGermanyRabat_Tourism">TLS Allemagne (tourisme) à
Rabat/MA</option>
<option value="TlsGermanyRabat_FamilyVisit">TLS Allemagne (visite
familiale) à Rabat/MA</option>
<option value="TlsFranceAnnaba_Case1">TLS France à Annaba (1ère
demande)/DZ</option>
<option value="TlsFranceAnnaba_Case2">TLS France à Annaba
(renouvellement ordinaire)/DZ</option>
<option value="TlsFranceAnnaba_Case3">TLS France à Annaba
(renouvellement circulation)/DZ</option>
</select>
<br>
<button id="selectHunterButton">Prendre un Rendez-Vous</button>
<br><br>
<label for="refreshHunterTime">Chercher chaque (secondes) :</label>
<input type="number" id="refreshHunterTime" name="refreshHunterTime"
value="300" required>
<br><br>
<div id="textHunterContainer">
<div id="statusT">Statut : </div>
<div id="messageZone">Prêt.</div>
</div>
</form>
</div>
<br>
<div id="linkHunter"><a href="https://www.termin-tracker-all.com"
target="_blank">www.termin-tracker-all.com</a></div>
`;

let inj_css = `
#messageZone {
text-align: center;
font-weight: bold;
font-size: 16px;
color: #336699;
display: inline-block;
}

#statusT {
text-align: center;
font-weight: bold;
font-size: 16px;
color: #336699;
display: inline-block;
}

label {
font-size: 16px;
color: #000000;
}

#textHunterContainer {
text-align: center;
}

#textHunterTitle {
color: #336699;
margin-top: 10px;
font-size: 22px;
text-align: center;
font-weight: bold;
}

#linkHunter {
color: #007bff;
text-decoration: none;
transition: color 0.3s ease;
font-size: 13px;
text-align: center;
}

#linkHunter:hover {
color: #0056b3;
text-decoration: underline;
font-size: 13px;
text-align: center;
}

button {
background-color: #336699;
color: #fff;
padding: 10px 20px;
font-size: 16px;
border: none;
border-radius: 5px;
cursor: pointer;
}

button:hover {
background-color: #214c7d;
}

select {
padding: 10px;
font-size: 16px;
width: 100%;
}
`;

// Injecter le HTML dans la page


let head = document.getElementsByTagName('head')[0];
let style = document.createElement('style');
style.innerHTML = inj_css;
head.appendChild(style);

let body = document.body;


body.insertAdjacentHTML('beforeend', inj_html);

// Actions du bouton de formulaire et autres


document.getElementById('selectHunterButton').addEventListener('click',
function(event) {
event.preventDefault();
let center = document.getElementById('itemHunterList').value;
let refreshTime = document.getElementById('refreshHunterTime').value;
startTracking(center, refreshTime);
});

function startTracking(center, refreshTime) {


let selectedCenter = centerInfo[center];
if (!selectedCenter) {
alert('Centre non valide.');
return;
}

let statusMessage = document.getElementById('messageZone');


statusMessage.textContent = `Recherche pour ${selectedCenter.code}...`;

// Ici, vous ajouteriez la logique pour vérifier les créneaux disponibles.


}

})();

You might also like