Duolingo farmer redirector

Used in union with DuoHacker to automatically farm XP without interaction

  1. // ==UserScript==
  2. // @name Duolingo farmer redirector
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Used in union with DuoHacker to automatically farm XP without interaction
  6. // @author JoRo-Code <JoRoCode@gmail.com>
  7. // @copyright JoRo-Code
  8. // @match https://www.duolingo.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
  10. // @grant none
  11. // @run-at document-end
  12. // ==/UserScript==
  13.  
  14. const DEBUG = false;
  15.  
  16. let mainInterval;
  17. const TIME_OUT = 1000;
  18.  
  19. const TRIGGER_URL = "https://www.duolingo.com/learn"
  20.  
  21. const CHINESE = "zs"
  22. const JAPANESE = "ja"
  23.  
  24. /*
  25. Make sure to start a language course before you run the farmer
  26.  
  27. Make sure that you have selected your language as your learning language on Duolingo,
  28. otherwise it will cause an error and be stuck in an infinite loop trying to start a lesson
  29. */
  30.  
  31. var LANGUAGE = JAPANESE
  32.  
  33. function getLessonURL() {
  34. var redirect_url = "https://duolingo.com/checkpoint/" + LANGUAGE + "/1/bigtest"
  35. return redirect_url
  36. }
  37.  
  38. function redirect(url) {
  39. window.location.replace(url);
  40. if (DEBUG) { console.log("Redirected to:" + window.location)}
  41. }
  42.  
  43. function main() {
  44. if (DEBUG) { console.log("Running main")}
  45.  
  46. var currentLocation = window.location;
  47.  
  48. if (DEBUG) { console.log("Current location: " + currentLocation)}
  49.  
  50. if (currentLocation == TRIGGER_URL) {
  51. if (DEBUG) { console.log("Calling redirect")}
  52.  
  53. var new_lesson = getLessonURL();
  54. redirect(new_lesson);
  55. }
  56. }
  57.  
  58. function start() {
  59. mainInterval = setInterval(main, TIME_OUT)
  60. }
  61.  
  62. (start)();

QingJ © 2025

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