Created
July 19, 2021 21:15
-
-
Save fhfaa/b14a2c623c17ea0f47eafd8d98ba55d3 to your computer and use it in GitHub Desktop.
Export Untappd photos, quick & dirty
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
// === RUN IN BROWSER DEV TOOLS === | |
// Requires: cURL set up and in path | |
// alterntively, change the generated command to whatever you like | |
// Log in to the Untappd website and open the gallery for any user: | |
// https://untappd.com/user/<USERNAME>/photos | |
// Auto-Click "Load more images" until there are no more (until button is hidden) | |
function more() { | |
const b = document.querySelector('.more_photos'); | |
if (b && b.style.display != 'none') { | |
b.click(); | |
// not enough later on, if too many images or too little RAM | |
setTimeout(more, Math.random() * 1000 + 1000); | |
} else { | |
console.warn('ALL LOADED'); | |
} | |
} | |
more(); | |
// ------------------------------------------------------------------------------ | |
// Once done, extract image URLs, convert to list of cURL calls, copy to clipboard | |
copy([].slice.call(document.querySelectorAll('.photo-inner img')).reverse().map((s, idx) => { | |
idx = ('' + idx).padStart(5, '0'); | |
return 'curl -L "' + s.dataset.original.replace(/\/(\w+)_640x640\.jpg/, `/$1_raw.jpg" > ./down/${idx}_$1.jpg`) | |
}).join('\r\n')); | |
// In any folder | |
// - create a subfolder called "down" | |
// - create a new .bat file and paste the contents of your clipboard into it | |
// - run the .bat file | |
// - images are downloaded to ./down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment