Last active
October 30, 2017 05:08
-
-
Save sscotth/626c6cf29466f3f8bd660558f5081151 to your computer and use it in GitHub Desktop.
Ebay search filter
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 Hide Ebay auctions unless "Buy it now" or near end for Greasemonkey/Tampermonkey | |
// @namespace sscotth.io | |
// @description Hides Ebay auctions unless "Buy it now" or near end | |
// @include https://www.ebay.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
(() => { | |
const timelimit = Date.now() + 1000 * 60 * 60 * 24 // ONE DAY FROM NOW IN MILLISECONDS | |
;[...document.querySelectorAll('.lvresult')].forEach(r => { | |
const hasEnd = r.querySelector('[timems]') | |
if (!hasEnd) { | |
// Buy it now | |
return | |
} | |
const endtime = +hasEnd.getAttribute('timems') | |
if (endtime - timelimit > 0) { | |
r.hidden = true | |
} | |
}) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment