EcoleDirecte - Consultation

01/09/2025 15:48:54

当前为 2025-09-01 提交的版本,查看 最新版本

// ==UserScript==
// @name        EcoleDirecte - Consultation
// @namespace   Violentmonkey Scripts
// @match       https://www.ecoledirecte.com/Consultation*
// @grant       GM_addStyle
// @version     1.1
// @author      -
// @description 01/09/2025 15:48:54
// @run-at      document-idle
// @license : MIT
// ==/UserScript==

/* Variables */

let done =false;

/* Fonctions */

function ConsolePrint(message)
{
  var startTime = new Date();
  console.log('[ED-Consultation] '+ startTime.toLocaleTimeString() + ' ' + message) ;
}

function SearchStudentsList() {

  let students = 0;
  let result = "\n";

  if (done)
    return;

  ConsolePrint('ED - CONSULTATION : SearchStudentsList');

  var eleves = document.getElementsByClassName("eleve");
  for (var i = 0; i < eleves.length; ++i) {
    let eleve = eleves[i]; /* .innerHTML; */
    var buttons = eleve.getElementsByTagName('button');

    /* Captation */

    for (var j= 0; j < buttons.length; ++j) {
      let button = buttons[j];
      var captions = button.getElementsByClassName("caption");
      for (var l= 0; l < captions.length; ++l) {
        var student_name = captions[l].textContent.trim();
        students++;
      }
    }

    /* Picture */

    for (var j= 0; j < buttons.length; ++j) {
      let button = buttons[j];
      var imgs = button.getElementsByTagName("img");
      for (var k= 0; k < imgs.length; ++k) {
        var image_URL = imgs[k].src;
      }
    }

    // result += `${i+1} <a href=\"${image_URL}\">${student_name}</a><br>\n`; /* HTML */
    result += `${i+1};${student_name};${image_URL}\n`; /* CSV */

  }

  if(students) {
    done = true;
    ConsolePrint(result);
  }
}

window.addEventListener('load', function() {
  setInterval(SearchStudentsList, 3000);
  SearchStudentsList();
}, false);

/* Application */
if (self == top) { /* run only in the top frame. we do our own frame parsing */
  ConsolePrint('STARTED');

}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址