aremesh / RBtoFIN

// ==UserScript==
// @name         RBtoFIN
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  LinkToTradingView and Robinhood
// @author       You
// @match        https://robinhood.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
  'use strict';
  LazyLoad();
})();

function LazyLoad() {
  $(".sidebar-content span").each(function (x, index) {
    if ($(index).html().indexOf("Shares") > 0) {
      $(index).html('')
    }
    if ($(index).html().indexOf("$") > 0) {
      $(index).html('')
    }
  });
  var x = document.getElementsByClassName("sidebar-content")[0].getElementsByTagName("a")
  var finalText = "";
  for (var i = 0; i < x.length; i++) {
    finalText += x[i].href.split("/")[4] + ","
  }

  window.open("https://finviz.com/screener.ashx?t=" + finalText.substr(0, finalText.length - 1))
}