Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ebay search filter
// ==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
You can’t perform that action at this time.