eToro - addon

try to take over the world!

  1. // ==UserScript==
  2. // @name eToro - addon
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.22
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://www.etoro.com/*
  8. // @grant none
  9. // ==/UserScript==
  10. // By MbNeo
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. setInterval(function(){
  16. if($(".head-info-stats-value").length>0){
  17. document.title = $(".head-info-stats-value")[0].innerText + "(" + $(".head-info-stats-change")[0].innerText.split("(")[1].replace(") ","") + ") - " + $(".user-nickname")[0].innerText + ")";
  18. var Sell = parseFloat($("[data-etoro-automation-id='buy-sell-button-rate-value']")[0].innerText.trim());
  19. var Buy = parseFloat($("[data-etoro-automation-id='buy-sell-button-rate-value']")[1].innerText.trim());
  20. if($("#mb_spread").length===0){
  21. if($("[ng-if=':: !marketCtrl.instrument.isPreview']").length>0){
  22. $("[ng-if=':: !marketCtrl.instrument.isPreview']").append('<span id=\'mb_spread\' style=\'color: orange;\'>...</span>');
  23. }
  24. } else {
  25. var fSpread = parseInt((Buy-Sell)*1000)/1000;
  26. var fSpreadPercent = parseInt(((fSpread/Buy)*100)*10)/10;
  27. $("#mb_spread")[0].innerHTML = "Buy= $" + Buy + " - " + "Spread= $" + fSpread + " (" + fSpreadPercent + "%)";
  28. }
  29. }
  30. },1000);
  31. })();