Created
June 1, 2013 18:49
-
-
Save elmendalerenda/5691347 to your computer and use it in GitHub Desktop.
Search Dublin apartments in Luas green line
This file contains hidden or 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
//do to http://www.daft.ie/lettings/ and run: | |
function selectOption(selector, optionsToSelect){ | |
var items = document.querySelectorAll(selector + ' > option'); | |
for (var item of items) { | |
for(var i = 0; i < optionsToSelect.length; i++){ | |
if(item.text.match(optionsToSelect[i]) ){ | |
item.selected = true; | |
console.log(item.text); | |
} | |
} | |
} | |
} | |
var places = '#pt_id'; | |
var selectedPlace = [/^Apartment/]; | |
var leases = '#lease'; | |
var selectedLeases = [/6 Month/]; | |
var areas = '#a_id'; | |
var selectedAreas = [/Ranelagh/, /Windy Arbour/, /Dundrum/ , /Stillorgan/ , /Sandyford/ , /Leopardstown/ , /Churchtown/ , /Milltown/ ]; | |
selectOption(areas, selectedAreas); | |
selectOption(places, selectedPlace); | |
selectOption(leases, selectedLeases); | |
var furnished = document.querySelector('#furnished_2'); | |
furnished.checked = true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment