Last active
August 11, 2017 15:54
-
-
Save riophae/5b40c5b14ea8299ba677dc03b53860c3 to your computer and use it in GitHub Desktop.
Get links of samples on PhotographyBlog.com
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
// Copy and paste to console to execute | |
function copyText(text) { | |
const temp = document.createElement('textarea') | |
temp.textContent = text | |
Object.assign(temp.style, { | |
position: 'absolute', | |
overflow: 'hidden', | |
display: 'block', | |
width: 0, | |
height: 0, | |
}) | |
document.body.appendChild(temp) | |
temp.select() | |
document.execCommand('copy') | |
document.body.removeChild(temp) | |
console.log(`Copied ${text.length} characters.`) | |
} | |
function getAllOriginalLinks() { | |
return [].slice.call(document.querySelectorAll('a')) | |
.filter(link => link.textContent === 'Download Original') | |
.map(link => link.href) | |
.join('\n') | |
} | |
copyText(getAllOriginalLinks()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment