Skip to content

Instantly share code, notes, and snippets.

@macbre
Created December 1, 2022 11:00
Show Gist options
  • Save macbre/a13902cc28ac460372bb2c1c5b4f427e to your computer and use it in GitHub Desktop.
Save macbre/a13902cc28ac460372bb2c1c5b4f427e to your computer and use it in GitHub Desktop.
Daft
// open any Daft page and go the dev console
clear();
const data = JSON.parse(document.querySelector('script[id="__NEXT_DATA__"]').textContent);
const listing = data.props.pageProps.listing;
console.log( listing.title );
// grab the images
const images = listing.media.images.map( img => img['size1440x960'] );
let idx = 10;
console.log(
images
.map( img => `wget "${img}" -U 'wget/daft' -O ${idx++}.jpg` )
.join('\n')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment