Lazy Student for dk

robot for dk.91huayi.com

  1. // ==UserScript==
  2. // @name Lazy Student for dk
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description robot for dk.91huayi.com
  6. // @author han2ee
  7. // @match http://dk.91huayi.com/*
  8. // @match http://dk.91huayi.com/course_ware/*
  9. // @run-at document-start
  10. // @grant unsafeWindow
  11. // ==/UserScript==
  12.  
  13. function playend() {
  14. //if (getDuration($("#ccid").val()) - getPosition($("#ccid").val()) < 200) {
  15. //var uid = '437c3b4b-0243-49ef-bd94-ce305122416c';
  16. //var cwrid = 'aa149adf-2eec-4234-a9df-2d60b6b03b31';
  17. //var cwid = 'b9cd9a3c-554a-450c-b138-0d47389f7373';
  18.  
  19. $.ajax({
  20. type: "POST",
  21. url: "../ashx/CourseWareFinish.ashx",
  22. data: {
  23. "uid": uid,
  24. "cwrid": cwrid,
  25. "iscommpany": ""
  26. },
  27. dataType: "text",
  28. error: function () {
  29. //alert("更新学习记录失败");
  30. },
  31. success: function (res) {
  32. console.log("end play");
  33. //alert(res);
  34. window.location = "http://dk.91huayi.com/exam/myexam_info.aspx";
  35. }
  36. });
  37. //}
  38. }
  39.  
  40. (function() {
  41. 'use strict';
  42. setInterval(function(){
  43. if(document.URL.startsWith('http://dk.91huayi.com/course_ware/course_ware_cc.aspx')) {
  44. playend();
  45.  
  46. } else if(document.URL.startsWith('http://dk.91huayi.com/exam/myexam_info.aspx')){
  47. if($("table a img")[0].title.startsWith("(未学习)")) {
  48. window.location = $("table a")[0].href;
  49. }
  50. }
  51. }, 3000);
  52. })();