Created
December 1, 2022 11:00
-
-
Save macbre/a13902cc28ac460372bb2c1c5b4f427e to your computer and use it in GitHub Desktop.
Daft
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
// 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