您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Calculates price per square meter
// ==UserScript== // @name Nepremicnine na m^2 // @namespace http://tampermonkey.net/ // @version 0.5 // @description Calculates price per square meter // @author semrola // @match https://www.nepremicnine.net/* // @icon https://www.google.com/s2/favicons?sz=64&domain=nepremicnine.net // @grant none // @require http://code.jquery.com/jquery-latest.js // ==/UserScript== (function() { 'use strict'; $('.property-details').each(function(idx, el) { let price = $(el).find('meta[itemprop=price]'); let priceValue = parseFloat(price.attr('content')); let size = $(el).find('ul li:first') let val = $(size).html(); let sizeText = $(val)[1].data let sizeValue = parseFloat(sizeText.toString().replace('.','')) //?.replace(',', '.')) let m2 = $(el).find('h6').html().includes('m') //console.log('priceValue', priceValue, 'sizeValue', sizeValue, 'm2', m2) let ratio = 0; if (m2) { ratio = Math.round(priceValue * sizeValue) } else { ratio = Math.round(priceValue / sizeValue) } price.after('<span>' + ratio + ' €' + (!m2 ? '/m2':'') + '</span>') }) })();