Skip to content

Instantly share code, notes, and snippets.

@gregwhitworth
Last active April 25, 2020 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregwhitworth/f9384f1626e0037cdefb2ae11dde4ca0 to your computer and use it in GitHub Desktop.
Save gregwhitworth/f9384f1626e0037cdefb2ae11dde4ca0 to your computer and use it in GitHub Desktop.
Get URLs to all Shopify urls
/*
Go to your files page under Settings -> Files
Open the devtools and run this script
You'll then inputTextArr which is an array of all CDN values for files on the page.
*/
let anchors = []
let inputTextArr = [];
let images = [];
document.querySelectorAll('td:nth-child(4) input').forEach((e) => { inputTextArr.push(e.value)});
document.querySelectorAll('table tr td:nth-child(3) a').forEach((e) => { anchors.push(e.textContent)});
anchors.forEach((anchor, i) => {
let href = inputTextArr[i];
images.push({
name: anchor,
href: inputTextArr[i]
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment