Skip to content

Instantly share code, notes, and snippets.

@swang
Last active December 24, 2015 13:38
Show Gist options
  • Select an option

  • Save swang/6806181 to your computer and use it in GitHub Desktop.

Select an option

Save swang/6806181 to your computer and use it in GitHub Desktop.
Filters out all the big drops for Yahoo Fantasy Football.
drops = document.querySelectorAll("table.Tst-table tr td.Ta-end:nth-child(even)")
adds = document.querySelectorAll("table.Tst-table tr td.Ta-end:nth-child(odd)")
owners = document.querySelectorAll("table.Tst-table tr td.Ta-start.Nowrap")
for (var i = 0; i < adds.length; i++) { if (!/W \(.*\)/i.test(owners[i].innerText) || parseInt(adds[i].innerText, 10) < parseInt(drops[i].innerText, 10)) { adds[i].parentNode.style.display = 'none' } }
drops = document.querySelectorAll("table.Tst-table tr td.Ta-end:nth-child(even)")
adds = document.querySelectorAll("table.Tst-table tr td.Ta-end:nth-child(odd)")
for (var i = 0; i < adds.length; i++) { if (parseInt(adds[i].innerText, 10) < parseInt(drops[i].innerText, 10)) { adds[i].parentNode.style.display = 'none' } }
owned = document.querySelectorAll("table.Tst-table tr td.Bdrend:nth-child(4) div a");
for (var i = 0; i < owned.length; i++) { owned[i].parentNode.parentNode.parentNode.style.display = 'none' };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment