Skip to content

Instantly share code, notes, and snippets.

@jruz
Created May 18, 2015 22:24
Show Gist options
  • Save jruz/3e32c2658f20f726dc64 to your computer and use it in GitHub Desktop.
Save jruz/3e32c2658f20f726dc64 to your computer and use it in GitHub Desktop.
Hide rooms that ask for more than 1 month stay
$('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