Memrise Simple Auto Learn

When enabled, memrise will auto learn. It does this by choosing a button at random, so the words will initially all be marked as "difficult". Unmark them as difficult after learning.

Stan na 06-03-2022. Zobacz najnowsza wersja.

// ==UserScript==
// @name         Memrise Simple Auto Learn
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  When enabled, memrise will auto learn. It does this by choosing a button at random, so the words will initially all be marked as "difficult". Unmark them as difficult after learning.
// @author       Ben Jenkins
// @match        https://app.memrise.com/aprender/learn*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=memrise.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    setInterval(() => {
        // Get the 4 answer buttons
        const answerButtons = document.querySelectorAll('div[data-testid="testLearnableCard"] button')

        const nextButton = document.querySelector('button[data-testid="next-button"]')

        const learnLink = document.querySelector('a[aria-label="learn"]')

        // if they exist click one at random
        if (answerButtons.length > 0) {
            console.log('Have answer buttons, clicking')
            const randomIndex = Math.floor(Math.random() * answerButtons.length)
            const randomAnswerButton = answerButtons[randomIndex]
            randomAnswerButton.click()
        } else if (nextButton) {
            console.log('Has next button, clicking')
            nextButton.click()
        } else if (learnLink) {
            console.log('Has learn next link, clicking')
            learnLink.click()
        }

    }, 50)

})();