aremesh / External_Lib

// ==UserScript==
// @exclude     *
// ==UserLibrary==
// @name        External_Lib
// @license     MIT
// ==/UserLibrary==
// ==/UserScript==

function GenerateLinks(stockName, existing, addBr) {
  var br = ""
  if (addBr) {
    br = "<br/>"
  }
  var sep = "|"
  var all = {
    existing: `${existing}`,
    tradingView: ` ${sep}<a target='_blank' href='https://www.tradingview.com/chart/?symbol=${stockName} '>TV</a>`,
    SEC: ` ${sep}<a target='_blank' href='https://www.sec.gov/cgi-bin/browse-edgar?CIK=${stockName}&action=getcompany&owner=exclude&type=s-8'>S8</a>${br}`,
    Zack: ` ${sep}<a target='_blank' href='https://www.zacks.com/stock/quote/${stockName}?q=${stockName}'>Zack</a>`,
    robinHood: `${sep}<a target='_blank' class='tab-link' href='https://robinhood.com/stocks/${stockName}'>RB</a>`,
    stockSplit: `${sep}<a target='_blank' class='tab-link' href='https://stocksplithistory.com?symbol=${stockName}'>StockSplit</a>${br}`,
    divHistory: `${sep}<a target='_blank' class='tab-link' href='https://nasdaq.com/symbol/${stockName}/dividend-history'>dividendhistory</a>`,
    yahoo: `${sep}<a target='_blank' class='tab-link' href='https://finance.yahoo.com/quote/${stockName}'>Yahoo</a>`,
    marketWatch: `${sep}<a target='_blank' class='tab-link' href='https://www.marketwatch.com/investing/stock/${stockName}/profile'>MarketWatch</a>${br}`,
    StockTwist: `${sep}<a target='_blank' class='tab-link' href='https://stocktwits.com/symbol/${stockName}'>StockTwist</a>`,
    // sunshineavenue: `${sep}<a target='_blank' class='tab-link' href=' http://sunshineavenue.com/stock/${stockName}'>sunshineavenue</a>`,
    SV: `${sep}<a target='_blank' class='tab-link' href=' http://shortvolumes.com/?t=${stockName}'>Short Volume</a>${br}`,
    MAcroaxis: `${sep}<a target='_blank' class='tab-link' href='https://www.macroaxis.com/invest/market/${stockName}'>MacroAxis</a>`,
    ETF: `${sep}<a target='_blank' class='tab-link' href='https://etfdb.com/stock/${stockName}'>ETF</a>`,
    Insider: `${sep}<a target='_blank' class='tab-link' href='http://insiderbuyingselling.com/?t=${stockName}'>InsiderBuying</a>`,
    TheLION: `${sep}<a target='_blank' class='tab-link' href='http://www.thelion.com/bin/aio_msg.cgi?cmd=search&symbol=${stockName}'>LION</a>`,
    Youtube: `${sep}<a target='_blank' class='tab-link' href='https://www.youtube.com/results?search_query=${stockName} stock'>Youtube</a>`,
    StockMonitor: `${sep}<a target='_blank' class='tab-link' href='https://www.members.stockmonitor.com/charts/?s=${stockName}&tf=daily stock'>Stock Monitor</a>`,
    Advice: `${sep}<a target='_blank' class='tab-link' href='https://www.macroaxis.com/invest/advice/${stockName}'>Advice</a>`
  }
  var finalLink = ''
  for (var prop in all) {
    // skip loop if the property is from prototype
    // your code
    finalLink += all[prop];
  }
  return finalLink;

}

function GenerateSimpleLinks(stockName, existing, addBr) {
  var br = ""
  if (addBr) {
    br = "<br/>"
  }
  var sep = ""
var all = {
    existing: `${existing}`,
    tradingView: `${sep} <a target = '_blank' href='https://www.tradingview.com/chart/?symbol=${stockName}'>Tvv</a>`
  }
  var finalLink = ''
  for (var prop in all) {
    // skip loop if the property is from prototype
    // your code
    finalLink += all[prop];
  }
  return finalLink;

}

function GenerateLowfloatLinks(stockName, existing, addBr) {
  var finalLink = GenerateSimpleLinks(stockName, existing, addBr)
  var sep = ""
  finalLink += ` ${sep}<a target='_blank' href='https://finviz.com/quote.ashx?t=${stockName} '>F</a>`

  return finalLink;

}