Skip to content

Instantly share code, notes, and snippets.

@arekolek
Last active December 3, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arekolek/d9cc31ec6cb133137049 to your computer and use it in GitHub Desktop.
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
// ==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