Skip to content

Instantly share code, notes, and snippets.

@0xd61
Created July 20, 2021 20:28
Show Gist options
  • Save 0xd61/1a84cde1899003654d160502cc41ce1d to your computer and use it in GitHub Desktop.
Save 0xd61/1a84cde1899003654d160502cc41ce1d to your computer and use it in GitHub Desktop.
// grab the URLs
var urls = $('.tile--img__img').map(function(idx, el) { return el.src});
// write the URls to file (one per line)
var textToSave = urls.toArray().join('\n');
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
hiddenElement.target = '_blank';
hiddenElement.download = 'urls.txt';
hiddenElement.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment