湖南开放大学自动刷课

学习视频

  1. // ==UserScript==
  2. // @name 湖南开放大学自动刷课
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description 学习视频
  6. // @author Aether
  7. // @match *.hnsydwpx.cn/*
  8. // @grant none
  9. // @run-at document-end
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. let hre = location.href;
  15. if (
  16. hre.match("www.hnsydwpx.cn/center.html")
  17. ) {
  18. setTimeout(() => {
  19. console.log('go to my course')
  20. document.querySelector('.center-main').childNodes[3].childNodes[5].childNodes[1].click()
  21. }, 2000)
  22.  
  23. setTimeout(() => {
  24. try {
  25. if (document.getElementsByClassName('iframe')[0].contentWindow.document.getElementById('LearnInCompleteCount').innerHTML != '0') {
  26. document.getElementsByClassName('iframe')[0].contentWindow.document.getElementById('LearnInCompleteCount').click()
  27. document.getElementsByClassName('iframe')[0].contentWindow.document.getElementById('LearnInCompleteArr').childNodes.item(0).getElementsByTagName('button')[0].click()
  28. }
  29. } catch(err) {
  30. window.location.reload();
  31. }
  32. }, 5000)
  33. }
  34.  
  35. if (hre.match("www.hnsydwpx.cn/play.html")) {
  36. setTimeout(() => {
  37. document.getElementById('courseCatalogue').childNodes.item(3).getElementsByTagName('div')[1].getElementsByTagName('a')[0].click()
  38. }, 5000)
  39. }
  40.  
  41. if (hre.match("www.hnsydwpx.cn/getcourseDetails.html")) {
  42. setInterval(() => {
  43. var cource_list = document.getElementById('courseCatalogue').querySelector('.list-item').querySelectorAll('.item-list')
  44. var finished = true
  45. for(var i = 0; i < cource_list.length; i ++) {
  46. if (cource_list[i].querySelector('.item-list-progress').innerHTML != '100%') {
  47. finished = false
  48. break
  49. }
  50. }
  51.  
  52. if (finished == true) {
  53. console.log("back home page")
  54. window.location.replace('https://www.hnsydwpx.cn/center.html')
  55. }
  56. }, 5000);
  57. }
  58. })();

QingJ © 2025

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