Skip to content

Instantly share code, notes, and snippets.

@sscotth
Last active October 30, 2017 05:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sscotth/626c6cf29466f3f8bd660558f5081151 to your computer and use it in GitHub Desktop.
Save sscotth/626c6cf29466f3f8bd660558f5081151 to your computer and use it in GitHub Desktop.
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