Created
July 23, 2021 08:38
-
-
Save lamchau/6e5fca89397e92f868da38275a98969f to your computer and use it in GitHub Desktop.
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
/** | |
* 1. [If not owner] Create a copy of the Google Documents link | |
* 2. Publish to web | |
* 3. [Chrome] Inspect page | |
* 4. Open Developer Console | |
* 5. Paste script below | |
* 6. From clipboard, paste to $EDITOR | |
* 7. Optional: Open multiple URLs Chrome extension | |
* - https://chrome.google.com/webstore/detail/open-multiple-urls/oifijhaokejakekmnjmphonojcfkpbbh | |
*/ | |
(() => { | |
const urls = Array.from(document.querySelectorAll('a')) | |
.map(x => { | |
const href = x.href; | |
if (href.includes('?')) { | |
const query = new URL(href).search; | |
const params = new URLSearchParams(query); | |
return params.get('q'); | |
} | |
return href; | |
}) | |
.filter(x => x && x.includes('http')) | |
.filter(x => !x.includes('englevels')); | |
copy(Array.from(new Set(urls)).join('\n')); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment