Last active
February 21, 2025 16:59
-
-
Save smarteist/9b49167a6d7911675f84aa5ec8512dd6 to your computer and use it in GitHub Desktop.
Revisions
-
smarteist revised this gist
Feb 21, 2025 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,9 @@ (function extractHrefsAsBashArray() { const domain = window.location; const links = document.querySelectorAll('body main.container div.list table.table tbody tr td a'); const hrefsArray = Array.from(links).map(link => { const href = link.getAttribute('href'); return href ? (href.startsWith('http') ? href : domain + href) : ''; }).filter(href => href); console.log(`urls=(\n ${hrefsArray.map(href => `"${href}"`).join('\n ')}\n)`); })(); -
smarteist revised this gist
Feb 21, 2025 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,9 @@ (function extractHrefsAsBashArray() { const domain = window.location.origin; const links = document.querySelectorAll('body main.container div.list table.table tbody tr td a'); const hrefsArray = Array.from(links).map(link => { const href = link.getAttribute('href'); return href ? (href.startsWith('http') ? href : domain + href) : ''; }).filter(href => href); console.log(`hrefs=( ${hrefsArray.map(href => `"${href}"`).join(' ')} )`); })(); -
smarteist created this gist
Feb 21, 2025 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ function extractHrefsAsBashArray() { const domain = window.location.origin; const links = document.querySelectorAll('body main.container div.list table.table tbody tr td a'); const hrefsArray = Array.from(links).map(link => { const href = link.getAttribute('href'); return href ? (href.startsWith('http') ? href : domain + href) : ''; }).filter(href => href); // Filter out empty strings console.log(`hrefs=( ${hrefsArray.map(href => `"${href}"`).join(' ')} )`); } extractHrefsAsBashArray();