Last active
July 1, 2019 11:08
-
-
Save ideasasylum/f8d13c9d28e8179eced2 to your computer and use it in GitHub Desktop.
Daft House Prices
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 Daft House Prices | |
// @namespace http://ideasasylum.com | |
// @version 0.2 | |
// @description Replace Daft house prices with CB deposit and income limits | |
// @author Jamie Lawrence @ideasasylum | |
// @match https://www.daft.ie/* | |
// @grant none | |
// ==/UserScript== | |
$('.PropertyInformationCommonStyles__costAmountCopy').each(function(index, element){ | |
var price_string = $(element).text(); | |
var price = price_string.replace(/\D/g,''); | |
var house_income_required = Math.floor(price / 3.5); | |
var house_deposit = Math.floor(price * 0.1); | |
if(price > 222000){ | |
house_deposit += Math.floor((price - 222000) * 0.2); | |
} | |
$(element).html("<s>"+price_string+"</s> Deposit of €"+house_deposit+" and €"+house_income_required+" income required"); | |
}); |
The script just converts the house prices on https://www.daft.ie into the deposit and income requirements specified by the central bank.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example: