Skip to content

Instantly share code, notes, and snippets.

@BarishNamazov
Last active January 26, 2023 09:48
Show Gist options
  • Save BarishNamazov/fc4b3993d3cd7228c4297e1cd994dcfe to your computer and use it in GitHub Desktop.
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
// ==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;
}
}
})();
@BarishNamazov
Copy link
Author

edit: lang was set to azerbaijani, now supports all langs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment