讨论 » 创建请求

Script for Copart and Iaai websites

§
发布于:2024-12-15

Hi,
Can anyone create this type of script: on these two examples (similar but different website) there are Lot(on iaai 'Stock') numbers, which we search in google and redirect to bid.cars website to check auction info. Can anyone make it easy that we not to need to search in google. e.g. If we click on lot/stock number it automatically show last sold price, or if it isn't possible , when we click on lot/stock number automatically redirect to bid.cars website with this lot number.(I have google extension but it will not work after 2024). If it isn't possible to create for both websites copart is priority. Thanks
https://www.copart.com/lot/84855114/salvage-2014-ford-fusion-se-hybrid-ca-hayward
https://bid.cars/en/lot/0-37802700/2014-Ford-Fusion-3FA6P0LU3ER306918
https://www.iaai.com/VehicleDetail/41584205~US
https://bid.cars/en/lot/0-41094087/2015-Honda-Civic-2HGFG4A50FH707001

§
发布于:2024-12-19

// ==UserScript==
// @name Autofind on bid.cars
// @namespace http://tampermonkey.net/
// @version 2024-12-19
// @description Will find current car on bid,cars if 3 is clicked while on a car page of iaai.com
// @author TTT
// @match https://www.iaai.com/*
// @include /^https:\/\/www\.google\.com\/search\?q=https%3A%2F%2Fbid\.cars%2Fen%2Flot%2F.*/
// @icon https://www.google.com/s2/favicons?sz=64&domain=iaai.com
// @grant none
// ==/UserScript==
document.addEventListener('keydown', function(event) {
if (event.key === '3') {
const dataItems = document.querySelectorAll('.data-list__item');
const extractedTextSet = new Set();

dataItems.forEach(item => {
if (item.innerText.includes("Stock #:")) {
const text = item.innerText.replace(/Stock #:?\s*/i, '').trim();
if (text) {
extractedTextSet.add(text);
}
}
});

let extractedText = Array.from(extractedTextSet).join(' ');

extractedText = extractedText.trim().replace(/\s+/g, ' ');

const headerElement = document.querySelector('.pd-header--left');
let headerText = "";
if (headerElement) {
headerText = headerElement.innerText.trim().replace(/\s+/g, '-');
}

const url = `https://www.google.com/search?q=https%3A%2F%2Fbid.cars%2Fen%2Flot%2F${encodeURIComponent(extractedText)}%2F${encodeURIComponent(headerText)}`;

window.open(url, '_blank');
}
});
setInterval(() => {
if (window.location.href.includes("google.com")) {
const targetLink = Array.from(document.querySelectorAll('a'))
.find(link => link.href.includes("bid.cars") && !link.href.includes("google.com"));

if (targetLink) {
window.location.href = targetLink.href;
}
}
}, 500);

§
发布于:2024-12-19

Big thanks , I didn't think that someone will do this job for free, I just tried. One question, it don't work on copart website, I changed iaai to copart in script text but don't work.

§
发布于:2024-12-19

i was bored so checked script requests, and i'll do copart next, didnt realize that was the main request

§
发布于:2024-12-19

i unfortunately cant make it work for copart since the vin number is partially cut and the the lot number is different, and those are really the only two viable ways to search them

§
发布于:2024-12-20

OK, Big Thanks.

发布留言

登录(不可用)以发布留言。

长期地址
遇到问题?请前往 GitHub 提 Issues。