Last active
June 23, 2024 02:31
-
-
Save JanPokorny/5283dd6a9c2698c5992aaa021767a8fd to your computer and use it in GitHub Desktop.
UserScript to be used with Tampermonkey (Chrome) or Greasemonkey (Firefox). When searching for buy-it-now items on eBay, shows the actual price instead of the bogus item price that some shitty sellers add.
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 eBay quit your bullshit | |
// @namespace Puf | |
// @version 0.1 | |
// @description When searching for buy-it-now items on eBay, shows the actual price instead of the bogus item price that some shitty sellers add | |
// @author Puf | |
// @match http://www.ebay.com/sch/* | |
// @grant GM_xmlhttpRequest | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var lis = document.querySelectorAll(".sresult.lvresult.clearfix.li"); | |
for(var li of lis) { | |
handleLi(li); | |
} | |
function handleLi(li) { | |
var href = document.querySelector("#"+li.id+" > h3 > a").href; | |
GM_xmlhttpRequest({ | |
method: "GET", | |
url: href, | |
onload: function(r) { | |
var re = /"convertedPrice":"(.+?)"/g, match, maxPrice = 0, maxPriceText = ""; | |
while((match = re.exec(r.responseText))) { | |
var price = parseInt(match[1].split(" ")[0], 10); | |
if(price > maxPrice) { | |
maxPrice = price; | |
maxPriceText = match[1]; | |
} | |
} | |
var span = document.querySelector("#"+li.id+" .lvprice.prc .bold"); | |
if(span.innerText != maxPriceText) | |
span.innerHTML = "<span>" + maxPriceText + "</span> <small>("+span.innerText.trim()+")</small>"; | |
}, | |
}); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment