pyAnywhere clickable file paths

subj

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği yüklemek için Tampermonkey gibi bir uzantı yüklemeniz gerekir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

Bu stili yüklemek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için Stylus gibi bir uzantı kurmanız gerekir.

Bu stili yükleyebilmek için Stylus gibi bir uzantı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

Bu stili yüklemek için bir kullanıcı stili yöneticisi uzantısı kurmanız gerekir.

Bu stili yükleyebilmek için bir kullanıcı stili yöneticisi uzantısı yüklemeniz gerekir.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         pyAnywhere clickable file paths
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  subj
// @author       Alex R
// @license      none
// @match        https://*.pythonanywhere.com/user/*/tasks_tab/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=pythonanywhere.com
// @grant        none
// ==/UserScript==
console.log("py")
let allTasks;
const suffix = "?edit";
const fileNameRE = /python3\.10(.*\.py)/;
const origin = "https://eu.pythonanywhere.com/user/alexdiscordbot/files/";
const notFound = setInterval(()=>{
    allTasks = Array.from(document.querySelectorAll(".wide-column.scheduled_tasks_command"));
    if (allTasks.length !== 0){
        clearInterval(notFound);
        allTasks.push(document.querySelector(".always_on_task_command"));
        main();
    }
}, 100);
function main(){
    allTasks.forEach(task=>{
        let filePath = task.textContent.match(fileNameRE)[1];
        console.log(filePath, filePath.startsWith(" mysite"));
        let newFilePath = filePath;
        if (filePath.startsWith(" mysite")) newFilePath = "/home/alexdiscordbot/" + filePath.trim();
        console.log("newFilePath", newFilePath)
        task.textContent = task.textContent.replace(filePath, "");
        let a = document.createElement("a");
        a.innerHTML = newFilePath;
        a.href = origin + newFilePath.trim() + suffix;
        task.appendChild(a);
    });
}
const loadedInterval = setInterval(()=>{
    const timeSpan = document.querySelector("#id_server_time");
    if (!timeSpan) return;
    const timeArr = timeSpan.textContent.split(":");
    document.querySelector("#id_scheduled_tasks_table > div > form > input:nth-child(2)").value = timeArr[0];
    document.querySelector("#id_scheduled_tasks_table > div > form > input:nth-child(3)").value = parseInt(timeArr[1]) + 1;
    clearInterval(loadedInterval);
}, 100);