// ==UserScript== // @name Commsec Research Helpers // @version 0.6 // @description Adds useful external links and optional auto data refresh to commsec quotes page // @author Salty Feet // @match *://*.commsec.com.au/quotes/* // @noframes // @license MIT // @run-at document-start; // ==/UserScript== var thisTicker,links,linkTitle,newContent,thisTimer; (function() { 'use strict'; })(); function clickRefreshBtn(){ if(document.getElementById("AutoRefresh").checked) { var mySpans = document.getElementsByTagName("span"); // Commsec does not use ID's in their objects so we have to search all spans to find the refresh button for(var i=0;i { if(e.target.checked) { thisTimer = setInterval(clickRefreshBtn, 10000);} else { window.clearInterval(thisTimer);} }); } // window.onload = function() { window.addEventListener('load', function() { var span = document.getElementById("overview-security-code"); thisTicker=span.textContent; /* NOTE: links are entered in the format: TITLE, LINK You will need to know where the ticker code is placed in the websites link. you should be able to open the site providing you info, navigate to the ticker you want and see where the ticker code is placed in the URL. Copy the URL (website address in full) and use the below sample as a guide to recreating it. Some websites must use lowercase - see the example/s below Check each change you make after doing it */ links = [ ["Charts", "https://www.tradingview.com/chart/?symbol=ASX:" + thisTicker.toLowerCase()], ["Hotcopper", "https://hotcopper.com.au/asx/" + thisTicker.toLowerCase() + "/?keywords=" ], ["Swingtradebot", "https://asx.swingtradebot.com/equities/" + thisTicker + ":ASX"], ["Barchart", "https://www.barchart.com/stocks/quotes/" + thisTicker + ".AX/opinion"], ["Commsec Research", "https://research.commsec.com.au/Securities/?app=com_cs_research_securities_summary&code=" + thisTicker], ["Twitter", "https://twitter.com/search?q=%24" + thisTicker.toLowerCase()], ["Shorts", "https://stocktrack.com.au/asx/" + thisTicker + "/shorts"], ["Market Index", "https://www.marketindex.com.au/asx/" + thisTicker], ]; addElements(); }, false); /* var styles = `.mrh {text-align: left;margin:0 2em 0 2em;padding:.5em;border: 2px outset wheat;} .mrh summary:hover { cursor: grab;}` var styleSheet = document.createElement("style") styleSheet.type = "text/css" styleSheet.innerText = styles document.head.appendChild(styleSheet) */