Send to VJudge

Get code submitted to other task sites and send it to VJudge

Від 10.08.2023. Дивіться остання версія.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Send to VJudge
// @namespace    -
// @version      4
// @description  Get code submitted to other task sites and send it to VJudge
// @author       Plantt
// @match        https://open.kattis.com/problems/*
// @match        https://open.kattis.com/contests/*/problems/*
// @match        https://cses.fi/problemset/*/*
// @match        https://oj.uz/problem/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=vjudge.net
// @grant        none
// @license      Unlicense
// ==/UserScript==

window.addEventListener("load", function() {
	var btn;
    if (document.URL.includes("https://open.kattis.com")) {
        btn = document.createElement("a");
        btn.innerText = "Send to VJudge";
        btn.className = "tab-nav-item tab-nav-js";
        btn.onclick = () => {
            window.open("https://vjudge.net/problem/kattis-" + document.URL.substr(document.URL.lastIndexOf("/") + 1), "_blank");
        };
        document.querySelector("#edit-and-submit-tab > div > div.strip-item-plain > nav").appendChild(btn);
    }
    else if (document.URL.includes("https://cses.fi")) {
        btn = document.createElement("li");
        btn.innerHTML = `<a href="https://vjudge.net/problem/cses-${document.URL.substr(document.URL.lastIndexOf("/") + 1)}" target="_blank">Send to VJudge</a>`;
        document.querySelector("body > div.skeleton > div.navigation > div.title-block > ul").appendChild(btn);
    }
	else if (document.URL.includes("https://oj.uz")) {
		btn = document.createElement("li");
		btn.innerHTML = `<a href="https://vjudge.net/problem/OJUZ-${document.URL.substr(document.URL.lastIndexOf("/") + 1)}" target="_blank">Send to VJudge</a>`;
		document.querySelector("#content > div > div > div.col-lg-9 > ul").appendChild(btn);
	}
});