Created
June 9, 2023 00:46
-
-
Save tylermenezes/aeaee3735fa4561a47eeb7696b6f97f2 to your computer and use it in GitHub Desktop.
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 characters
(() => { | |
const bookmarks = [...document.querySelectorAll('.entry')] | |
.filter((entry) => entry.querySelector('a.title')) | |
.map((entry) => { | |
const title = entry.querySelector('a.title').textContent; | |
const link = entry.querySelector('a.title').href; | |
const subreddit = entry.querySelector('.subreddit').textContent.replace('r/', ''); | |
return `<DT><A HREF="${link}" PRIVATE="0" TOREAD="0" TAGS="${subreddit}">${title}</A>`; | |
}); | |
console.log(`<!DOCTYPE NETSCAPE-Bookmark-file-1> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<TITLE>Bookmarks</TITLE> | |
<H1>Bookmarks</H1> | |
<DL><p> | |
${bookmarks.join(`\n`)} | |
</DL></p>`); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment