Last active
August 5, 2021 16:15
-
-
Save chalkpe/3aa6223ef22df4ea5fc622446e83b034 to your computer and use it in GitHub Desktop.
filter best parses per job for FF Logs website
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
// ==UserScript== | |
// @name filter-best-parses | |
// @namespace https://gist.github.com/ChalkPE | |
// @version 1.0 | |
// @description filter best parses per job for FF Logs website | |
// @match https://*.fflogs.com/* | |
// @run-at document-idle | |
// ==/UserScript== | |
(() => { | |
const sort = sorter => (sorter.click(), sorter.click()) | |
const display = v => elem => elem && (elem.style.display = v) | |
const job = row => row.querySelector`.rank-percent img`.className | |
const bad = (row, index, rows) => index !== rows.findIndex(r => job(row) === job(r)) | |
const hide = (...rows) => (bads => (bads.forEach(display`none`), bads))(rows.filter(bad)) | |
display`none`(document.querySelector`#top-box`) | |
display`none`(document.querySelector`#qc-cmp2-container`) | |
display`inherit`(document.querySelector`#guild-and-server`) | |
sort(document.querySelector`#boss-table thead th:first-child`) | |
return hide(...document.querySelectorAll`#boss-table tbody tr`) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment