FuckEducoder

解除头歌复制粘贴限制,针对UVA算法题目自动填充答案,设置随机测试时间

  1. // ==UserScript==
  2. // @name FuckEducoder
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.5
  5. // @description 解除头歌复制粘贴限制,针对UVA算法题目自动填充答案,设置随机测试时间
  6. // @author SunSeaLucky
  7. // @match https://www.educoder.net/tasks/*
  8. // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
  9. // @grant none
  10. // @require https://cdn.jsdelivr.net/npm/js-base64@3.7.5/base64.min.js
  11. // @connect service-q3vdttin-1301163996.bj.apigw.tencentcs.com
  12. // @run-at document-start
  13. // @license MIT
  14. // ==/UserScript==
  15.  
  16. const max = 30000;
  17. const min = 5000;
  18.  
  19. const requestError = "//RequestError: May this time serve is closed! Try again at another time.";
  20.  
  21. // 目前设置随机时间的方法出现严重Bug,请谨慎使用!
  22. // 若仍想快速刷时间,请进入微信头歌小程序,在对应的实例界面左右滑动,可快速刷到int最大值
  23. const setRandomTime = false;
  24.  
  25. (function () {
  26. 'use strict';
  27. let oldFetch = fetch;
  28. function hookFetch(...args) {
  29. return new Promise((resolve, reject) => {
  30. oldFetch.apply(this, arguments).then((response) => {
  31. if (arguments[0].indexOf('homework_common_id') !== -1) {
  32. const oldJson = response.json;
  33. response.json = function () {
  34. return new Promise((resolve, reject) => {
  35. oldJson.apply(this, arguments).then((result) => {
  36. if (setRandomTime) result.game.cost_time = Math.floor(Math.random() * (max - min + 1)) + min;
  37. result.shixun.forbid_copy = false;
  38. result.shixun.vip = true;
  39. resolve(result);
  40. });
  41. });
  42. };
  43. } else if (arguments[0].indexOf('rep_content') !== -1 && arguments[0].indexOf('tasks') !== -1) {
  44. const oldJson = response.json;
  45. response.json = function () {
  46. return new Promise((resolve, reject) => {
  47. oldJson.apply(this, arguments).then((result) => {
  48. let pattern = /uva(.*)\./,
  49. str = result.filename,
  50. questionCode = pattern.exec(str);
  51.  
  52. if (questionCode) {
  53. let url = "https://service-q3vdttin-1301163996.bj.apigw.tencentcs.com/release/FuckEducoder?question=" + questionCode[1] + "&vertification=DLloIbnmoTpobbpg6gKdm9pZCBwaWxlX29udG8oaW50IHAsIG";
  54. requsets(url)
  55. .then(res => {
  56. //TODO if this request cannot return any text, user can't input or view the code UI too.
  57. result.content.content = JSON.parse(res).data;
  58. resolve(result);
  59. })
  60. } else {
  61. resolve(result);
  62. }
  63. });
  64. });
  65. };
  66. }
  67. resolve(response);
  68. });
  69. });
  70. }
  71.  
  72. window.fetch = hookFetch;
  73.  
  74. async function requsets(url) {
  75. try {
  76. const response = await fetch(url, { method: "POST" });
  77. return await response.text();
  78. } catch (error) {
  79. return Base64.encode(requestError);
  80. }
  81. }
  82. })();
  83.  

QingJ © 2025

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