Skip to content

Instantly share code, notes, and snippets.

@xat
Created February 9, 2014 12:41
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 xat/8898538 to your computer and use it in GitHub Desktop.
Save xat/8898538 to your computer and use it in GitHub Desktop.
automatic answerscript for speedsums.com: Just open the page and execute this script in your JS console.
(function($) {
var $question = $('#question');
var $answer = $('#answer');
var checkInterval = 250;
var cheat = function() {
var rawVal = $question.html();
rawVal = rawVal.replace(' =', '')
.replace('x', '*')
.replace('÷', '/');
$answer.focus();
rawVal && $answer.val(eval(rawVal)) && $answer.trigger('keyup');
$answer.is(':visible') && setTimeout(cheat, checkInterval);
};
setTimeout(cheat, checkInterval);
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment