Skip to content

Instantly share code, notes, and snippets.

@ideasasylum
Last active July 1, 2019 11:08
Show Gist options
  • Save ideasasylum/f8d13c9d28e8179eced2 to your computer and use it in GitHub Desktop.
Save ideasasylum/f8d13c9d28e8179eced2 to your computer and use it in GitHub Desktop.
Daft House Prices
// ==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");
});
@ideasasylum
Copy link
Author

ideasasylum commented Feb 6, 2015

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