Skip to content

Instantly share code, notes, and snippets.

@cryptoeraser
Last active December 5, 2018 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cryptoeraser/423b032e7feee5b64303ff681c4cf28a to your computer and use it in GitHub Desktop.
Save cryptoeraser/423b032e7feee5b64303ff681c4cf28a to your computer and use it in GitHub Desktop.
/*
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}`);
}
}
}
@cryptoeraser
Copy link
Author

How this is supposed to work? In the following way:

  • Go to vcdepth.io.
  • Click "View All" to load the table with all coins (~976 coins).
  • Paste this script in your browser's console.
  • Change the var select = ['EOS', 'XMR', 'ZEC'] bit to include the coins you are interested in.
  • Run the script.

The result should be a filtered down table that displays only those coins you are interested in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment