Last active
January 26, 2023 09:48
-
-
Save BarishNamazov/fc4b3993d3cd7228c4297e1cd994dcfe to your computer and use it in GitHub Desktop.
This script adds the problem number to eolymp problem title in contest problems
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 Eolymp Group Problem Number | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description it's hard to know the problem number in eolymp groups, use this for more efficiency | |
// @author Barish Namazov | |
// @match https://www.eolymp.com/*/contests/*/problems/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=eolymp.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const lastEl = a => a[a.length-1]; | |
for (const el of document.querySelectorAll('a')) { | |
const url = el.href; | |
if (url.indexOf("submissions/submit?problem=") !== -1) { | |
const pnum = lastEl(url.split("problem=")); | |
document.querySelector("h1.eo-paper__header").textContent += "; " + pnum; | |
break; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
edit: lang was set to azerbaijani, now supports all langs