Skip to content

Instantly share code, notes, and snippets.

@lamchau
Created July 23, 2021 08:38
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 lamchau/6e5fca89397e92f868da38275a98969f to your computer and use it in GitHub Desktop.
Save lamchau/6e5fca89397e92f868da38275a98969f to your computer and use it in GitHub Desktop.
/**
* 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