Skip to content

Instantly share code, notes, and snippets.

@chalkpe
Last active August 5, 2021 16:15
Show Gist options
  • Save chalkpe/3aa6223ef22df4ea5fc622446e83b034 to your computer and use it in GitHub Desktop.
Save chalkpe/3aa6223ef22df4ea5fc622446e83b034 to your computer and use it in GitHub Desktop.
filter best parses per job for FF Logs website
// ==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