Skip to content

Instantly share code, notes, and snippets.

@mariusbutuc
Last active December 12, 2015 20:35
Show Gist options
  • Save mariusbutuc/5a25fa973721fde0ffa7 to your computer and use it in GitHub Desktop.
Save mariusbutuc/5a25fa973721fde0ffa7 to your computer and use it in GitHub Desktop.

Better condos.ca

  • download_slides: get the photos of the unit
  • essence: remove noise, while keeping only unit specific details
$('.slides li img').each(function(index, img) {
var originalFileName = img.src.split('/').pop();
var newFileName = index + ' ' + originalFileName;
var a = $('<a>')
.attr('href', img.src)
.attr('download', newFileName)
.appendTo('body');
a[0].click();
a.remove();
});
var noisyElements, noise;
noisyElements = [
'#global_header',
'#book-viewing',
'#global_footer',
'#building_expert_box',
'#comparable_nearby_div',
'#other_listing_block',
'#featured_slider_right',
'.sidebox',
'.units_navigation',
'.share'
];
noise = noisyElements.join(', ');
$(noise).remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment