Last active
December 5, 2018 19:28
-
-
Save cryptoeraser/423b032e7feee5b64303ff681c4cf28a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
https://vcdepth.io DOM Filtering Script | |
Author: @cryptoeraser | |
Community: Bitcoin Trading Challenge | |
*/ | |
var x = document.getElementsByClassName("table dataTable"); | |
tableOne_tbody = x[0].childNodes[2] | |
tableTwo_tbody = x[1].childNodes[2] | |
var select = ['EOS', 'XMR', 'ZEC'] | |
for (let index = 0; index < tableOne_tbody.rows.length; ++index) { | |
let a = tableOne_tbody.rows[index] | |
let name = a.children[0].innerText | |
let ticker = a.children[0].lastChild.innerText | |
if (select.includes(ticker)) { | |
tableOne_tbody.rows[index]['toRemove'] = false | |
tableTwo_tbody.rows[index]['toRemove'] = false | |
} else { | |
tableOne_tbody.rows[index]['toRemove'] = true | |
tableTwo_tbody.rows[index]['toRemove'] = true | |
} | |
} | |
for (let i = 0, limit = tableOne_tbody.rows.length; i < limit; ++i) { | |
if (tableOne_tbody.rows[i].toRemove) { | |
try { | |
tableOne_tbody.rows[i].remove(); | |
tableTwo_tbody.rows[i].remove(); | |
limit-- | |
i-- | |
} catch (err) { | |
console.log(`ERROR: ${err}`); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How this is supposed to work? In the following way:
var select = ['EOS', 'XMR', 'ZEC']
bit to include the coins you are interested in.The result should be a filtered down table that displays only those coins you are interested in.