Last active
December 29, 2018 16:18
-
-
Save cryptoeraser/37e62c8ac8c21a588638a11b54d5e10a to your computer and use it in GitHub Desktop.
Improved and more advanced version of the initial filter_ticker. Credit goes to @m59.
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: @m59 | |
Community: Bitcoin Trading Challenge | |
Notes: Improved and optimised version by @m59. | |
*/ | |
const pairs = ['EOS', 'XMR', 'ZEC'] | |
const zip = ([ a, b ]) => a.map((v, index) => [ v, b[index] ]) | |
Array.prototype.flat = function () { return this.reduce((acc, v) => acc.concat(v), []) } | |
zip([ ...document.querySelectorAll('.dataTable tbody') ].map(node => [ ...node.children ])) | |
.map(rowElements => ({ ticker: rowElements[0].querySelector('a:last-child').textContent, rowElements })) | |
.filter(({ ticker }) => !pairs.includes(ticker)) | |
.map(({ rowElements }) => rowElements) | |
.flat() | |
.forEach(element => element.remove()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My pairs are: