DoneDeal

For car search: Convert (miles) mileage to km, and (£) price to €, so that the list contains consistent information, and item page

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         DoneDeal
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  For car search: Convert (miles) mileage to km, and (£) price to €, so that the list contains consistent information, and item page
// @author       You
// @match        https://www.donedeal.ie/cars*
// @match        https://www.donedeal.ie/cars-for-sale/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=donedeal.ie
// @grant        none
// @require         https://code.jquery.com/jquery-3.6.3.min.js
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    if (document.location.href.includes ('/cars-for-sale/')) { /* Details page */
        $('div[class|="KeyInfoList__Text"]:contains(" mi")').css('color','red').each(function() {
            $( this ).text (Math.round(parseInt ($( this ).text().replace (" mi", "").replace (",", "")) * 1.609).toLocaleString() + " km");
        });
        $('p[class|="Price__CurrentPrice"]:contains("£")').css('color','red').each(function() {
            $( this ).text ("€" + Math.round(parseInt ($( this ).text().replace ("£", "").replace (",", "")) * 1.14).toLocaleString());
        });
    } else if (document.location.href.includes ('/cars')) { /* List page */
        $('div[class|="Card__Body"] li[class|="Card__KeyInfoItem"]:contains(" mi")').css('color','red').each(function() {
            $( this ).text (Math.round(parseInt ($( this ).text().replace (" mi", "").replace (",", "")) * 1.609).toLocaleString() + " km");
        });
        $('p[class|="Card__InfoText"]:contains("£")').css('color','red').each(function() {
            $( this ).text ("€" + Math.round(parseInt ($( this ).text().replace ("£", "").replace (",", "")) * 1.14).toLocaleString());
        });
    }
})();