Monday, March 13, 2017

getachart()

function getachart() {

function thelisting() {
var thecurrentlistnote = document.getElementById("sns20170311sa1558thecurrentlistnote")
var thecurrentlistnotearray = thecurrentlistnote.innerHTML.split(" ")
var thecurrentlisttype = thecurrentlistarray[0]
var thelist = document.getElementById("sns20170311sa1558" + thecurrentlisttype)
var thelistarray = thelist.innerHTML.split("<br />")
var thischart = document.getElementById("sns20170311sa1558this" + thecurrentlisttype)
var thechartnumber = parseInt(thischart.innerHTML)
var thislisting = thelistarray[thechartnumber]
return thislisting}

var thelisting = thelisting()
var thelistingarray = thelisting.split(" ")
var theurl = thelistingarray[0]
if (theurl[0] != "h") {
theurl = gettheupdater(theurl)}
document.getElementById("sns20170311sa1558i").src = theurl
thelistingarray.shif()
var thepattern = thelistingarray.join(" ")
document.getElementById("sns20170311sa1558thenote").innerHTML = thepattern

it turns out listings in the updater list are different from record list listings

it turns out all record listings begin with a symbol, so: symbol url pattern
while not all updater listings begin with a symbol

the next function needs to know ... but it does, anyway ...
whether ...
so, updater listings may be of the type symbol pattern
or of the type url pattern

if next() is working on a record list
it simply updates the record list symbol when it gets the chart

if next() is working on an updater list
as it checks forward for a matching pattern
when a record is of the symbol pattern type
next() updates the updater symbol note


function gettheupdater() {
var thecurrentlist = document.getElementById("sns20170311sa1558thecurrentlist")
var thelistarray = thecurrentlist.innerHTML.split(" ")
var thelisttype = thelistarray[0]
var thesymbol = document.getElementById("sns20170311sa1558current" + thelisttype + "symbol")
var chartspan = document.getElementById("sns20170311sa1558chartspan")
var thischartspan = parseInt(chartspan.innerHTML)
var updaterbase = "http://elite.finviz.com/chart.ashx?t="
var updatertopliteral = "&ty=c&ta=0&p=i3&s=l &ty=c&ta=0&p=i15&s=l &ty=c&ta=st_c,sch_200p,sma_50,sma_200,sma_20&p=d&s=l &ty=c&ta=0&p=w&s=l &ty=c&ta=0&p=m&s=l"
var updatertoparray = updatertopliteral.split(" ")
return updaterbase + thesymbol + updatertoparray[thischartspan]}

function thesymbol(thelisting) {
var thelistingarray = thelisting.split(" ")
if (thelistingarray[0][0] === "h") {
return thelistingarray[0].split(

No comments:

Post a Comment