Duolingo Known-to-New Practice

Strip all but known-to-new language exercises from the timed practice of Duolingo.

目前为 2016-09-13 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Duolingo Known-to-New Practice
  3. // @namespace unkkatkumiankka
  4. // @version 0.1
  5. // @description Strip all but known-to-new language exercises from the timed practice of Duolingo.
  6. // @author unkkatkumiankka
  7. // @match https://www.duolingo.com/*
  8. // @grant none
  9. // @require https://cdnjs.cloudflare.com/ajax/libs/xhook/1.3.5/xhook.min.js
  10. // @run-at document-start
  11. // ==/UserScript==
  12.  
  13. xhook.after(function(request,response){
  14. if(typeof request.url != 'undefined'){
  15. if(request.url.indexOf('global_practice') !== -1){
  16. injson = JSON.parse(response.text);
  17. var elems = injson.session_elements;
  18. var i=0;
  19. while(i<elems.length){
  20. if(elems[i].specific_type != 'reverse_translate'){
  21. elems.splice(i,1);
  22. }else{
  23. i++;
  24. }
  25. }
  26. response.text = JSON.stringify(injson);
  27. }
  28. }
  29. });

QingJ © 2025

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