Last active
December 3, 2015 14:02
-
-
Save arekolek/d9cc31ec6cb133137049 to your computer and use it in GitHub Desktop.
Archived, doesn't work anymore. A userscript for Duolingo that lets give out many lingots at once
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Duolingo Lingot Philanthropy | |
// @namespace http://github.com/arekolek | |
// @include https://www.duolingo.com/* | |
// @version 1.0 | |
// @grant none | |
// ==/UserScript== | |
function setIntervalLimited(fn, n, t) { | |
if(n <= 0) return; | |
setTimeout(function() {fn(); setIntervalLimited(fn, n-1, t)}, t); | |
} | |
var lover = function() { | |
var love = parseInt(prompt("How many lingots would you like to give away?", "1")); | |
if(love > 0 && (love <= 10 || confirm("Sure you want to give "+love+" lingots away?"))) | |
setIntervalLimited((function(){this.model.giveLove()}).bind(this), love, 200); | |
return false; | |
} | |
duo.CommentView = duo.CommentView.extend({ | |
giveLove: lover | |
}); | |
duo.CompactCommentView = duo.CompactCommentView.extend({ | |
giveLove: lover | |
}); | |
duo.NestedCommentView = duo.NestedCommentView.extend({ | |
giveLove: lover | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment