NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Link SD and TM // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author Anko and Budz // @include https://sorare.com/* // @icon https://www.google.com/s2/favicons?domain=sorare.com // @grant none // @require https://code.jquery.com/jquery-2.1.4.min.js // @license MIT // ==/UserScript== (function() { 'use strict'; window.addEventListener("load",() => { setInterval(function(){ findPlayer(); }, 500); }); function addButtonSD(text) { let button = document.createElement("button"), btnStyle = button.style; document.body.appendChild(button); // Setting function for button when it is clicked. $(button).css("background-image","url('https://www.soraredata.com/static/media/logos_soraredata_sidebar-03.21de2a4e08218d7ee0bd9d53a2dcf0ea.svg')"); $(button).css("background-color"," #056155"); $(button).css("background-size","cover"); $(button).css("background-repeat","no-repeat"); $(button).css("width"," 30px"); $(button).css("height"," 30px"); $(button).css("cursor"," pointer"); $(button).css("margin-left"," 20px"); $(button).css("box-shadow", "10px 5px 5px rgba(0, 0, 0, 0.8)"); $(button).attr("id","sorare_data_btn"); $(button).attr("onclick", 'window.open(\'https://www.soraredata.com/playerSearch/'+text+'\')'); return button; } function addButtonTM(text) { let button = document.createElement("button"), btnStyle = button.style; document.body.appendChild(button); // Setting function for button when it is clicked. $(button).css("background-image","url('https://upload.wikimedia.org/wikipedia/commons/f/fb/Transfermarkt_favicon.png')"); $(button).css("background-size","cover"); $(button).css("background-repeat","no-repeat"); $(button).css("width"," 30px"); $(button).css("height"," 30px"); $(button).css("cursor"," pointer"); $(button).css("margin-left"," 40px"); $(button).css("box-shadow", "10px 5px 5px rgba(0, 0, 0, 0.8)"); $(button).attr("id","tm_data_btn"); $(button).attr("onclick", 'window.open(\'https://www.transfermarkt.fr/schnellsuche/ergebnis/schnellsuche?query='+text+'\')'); return button; } function findPlayer() { let divPlayer; if(window.location.href.includes("https://sorare.com/players/")){ divPlayer = $(".MuiTypography-h2").first(); }else if(window.location.href.includes("https://sorare.com/cards/")){ if($(".MuiDialog-paper").size() > 0){ divPlayer = $(".MuiDialog-paper").find(".MuiTypography-h4").first(); }else{ divPlayer = $(".MuiTypography-h4").first(); } } if(divPlayer != null){ let playerName = divPlayer.text(); playerName = encodeURI(playerName.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase()); console.log("player name :"+playerName); $("#sorare_data_btn").remove(); $("#tm_data_btn").remove(); divPlayer.append(addButtonSD(playerName)); divPlayer.append(addButtonTM(playerName)); } } })();