Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save emersonlaurentino/0da297cc5a92e9f587d03f34b6d2b0c8 to your computer and use it in GitHub Desktop.
Save emersonlaurentino/0da297cc5a92e9f587d03f34b6d2b0c8 to your computer and use it in GitHub Desktop.
alboompro
/**
* Before running this code, you need to run this script on the web page:
* urls = []
document.querySelectorAll(".src-components-Client-Common-___Common__photo___3yTw5 > img").forEach((item) => {
const url = item.src.replace("alfred.alboompro.com/resize/width/300/url/", "")
if (!urls.includes(url)) {
urls.push(url)
}
})
* after that, copy the urls array and paste it in the urls variable below
* then run the code
*/
const urls = [""];
function downloadPhotos(urls: string[]) {
urls.forEach(async (url, index) => {
const fileName = `photo-${index + 1}.jpg`;
console.log("start downloading: ", fileName);
const result = await fetch(url);
await Bun.write(`imgs/${fileName}`, result);
console.log("downloaded: ", fileName);
});
}
downloadPhotos(urls);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment