- Go to app.memrise.com/community/courses
- Open
Developer toolsand go to theConsoletab - Copy the code from
script.jsfrom this gist, then paste it into the console and hit enter - Done!
Last active
February 11, 2024 16:59
-
-
Save salif/87d3dd91da85613b3c8e19d228b4c41c to your computer and use it in GitHub Desktop.
Memrise - Sort courses by length / amount of words
This file contains hidden or 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
| const asc = false | |
| function g(x) { | |
| const d = x.querySelector('.stats > :nth-child(2)').childNodes[2].nodeValue.trim() | |
| const l = d.indexOf('h') | |
| const m = d.indexOf('m') | |
| if (l > -1) { | |
| return [x, d, parseInt(d.substring(0, l)) * 60] | |
| } else if (m > -1) { | |
| return [x, d, parseInt(d.substring(0, m))] | |
| } else { | |
| return [x, d, 0] | |
| } | |
| } | |
| const b = document.querySelector('div[data-role="infinite-scrolling-content"]') | |
| const a = Array.from(b.children).map(e=>g(e)) | |
| a.sort(function(f, s) { | |
| return asc ? f[2] - s[2] : s[2] - f[2] | |
| }) | |
| a.forEach(e=>{ | |
| b.insertBefore(e[0], null) | |
| }) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For ascending sort change
asc = falsetoasc = true