学习公社

个人学习专用

  1. // ==UserScript==
  2. // @name 学习公社
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-06-20
  5. // @description 个人学习专用
  6. // @author You
  7. // @match https://study.enaea.edu.cn/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=enaea.edu.cn
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Your code here...
  17. var log = function(...args){
  18. const now = new Date();
  19. const year = now.getFullYear();
  20. const month = String(now.getMonth() + 1).padStart(2, '0');
  21. const day = String(now.getDate()).padStart(2, '0');
  22. const hours = String(now.getHours()).padStart(2, '0');
  23. const minutes = String(now.getMinutes()).padStart(2, '0');
  24. const seconds = String(now.getSeconds()).padStart(2, '0');
  25. const formattedDateTime = `[${year}-${month}-${day} ${hours}:${minutes}:${seconds}]`;
  26. console.log(formattedDateTime, ...args);
  27. };
  28. var interval = 1000;
  29.  
  30. function main(){
  31. log("油猴脚本加载...");
  32. function click(){
  33. log("click...");
  34. // 继续学习
  35. var btn_study = document.querySelector("#rest_tip > table > tbody > tr:nth-child(2) > td.td-content > div.dialog-button-container > button");
  36. if (btn_study) {
  37. btn_study.click();
  38. log("btn_study", btn_study);
  39. }
  40. }
  41. var intervalID = setInterval(click, interval);
  42. }
  43. if (document.readyState === "complete") {
  44. // DOM 已经加载完成
  45. main();
  46. } else {
  47. // DOM 还未加载完成
  48. window.onload = main;
  49. }
  50. })();

QingJ © 2025

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