Created
May 18, 2015 22:24
-
-
Save jruz/3e32c2658f20f726dc64 to your computer and use it in GitHub Desktop.
Hide rooms that ask for more than 1 month stay
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
$('article.item').each(function(){ | |
var self = $(this) | |
, id = self.attr('data-adid') | |
, url = 'http://www.idealista.com/inmueble/' + id; | |
$.get(url).done(function(res, status){ | |
var text = $(res).find("#details li:contains('Estancia mínima de')").first().text(); | |
var months = parseInt(text.replace('Estancia mínima de', '').replace('meses', '').trim()); | |
if (months > 1) { | |
self.hide(); | |
} | |
console.log(url, months); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment