A bookmarklet for filtering listings by availability date and number of bedrooms.
Create a bookmark with the following code as URL:
javascript:(function () { var query = prompt("Select months/bedrooms", "may,jun,jul,aug,sep").split(',').map(function (s) { return s.trim().slice(0, 3).toLowerCase(); }); var testBedrooms = query.some(function (q) { return (/\d+/).test(q); }); var listingResults = document.querySelector("ul.listing-results"); Array.from(document.querySelectorAll("ul.listing-results > li")).filter(function (li) { var from = li.getElementsByClassName("available-from"); if (from.length < 1) return true; from = from[0].innerText.split(' '); if (from.length < 4) return true; from = from[3].trim().slice(0, 3).toLowerCase(); if (!query.includes(from)) return true; if (testBedrooms) { var beds = li.getElementsByClassName("num-beds"); if (beds.length > 0) { beds = beds[0].innerText; if (!query.includes(beds)) return true; } } return false; }).forEach(function (li) { listingResults.removeChild(li); }); })();
Copyright © 2019-2020 Pavlos Georgiou
This bookmarklet is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar, which is reproduced below:
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.