Created
January 23, 2023 22:29
-
-
Save mekarpeles/fc40c5a2250cff801a3a8e28743a7cad to your computer and use it in GitHub Desktop.
goodreads rss to ol query
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
var isbnList = [] | |
fetch("https://www.goodreads.com/review/list_rss/118293813?shelf=%23ALL%23") | |
.then(response => response.text()) | |
.then(data => { | |
let parser = new DOMParser(); | |
let xmlDoc = parser.parseFromString(data, "application/xml"); | |
let isbnTags = xmlDoc.getElementsByTagName("isbn"); | |
for (let i = 0; i < isbnTags.length; i++) { | |
if (isbnTags[i].innerHTML !== "") { | |
isbnList.push(isbnTags[i].innerHTML); | |
} | |
} | |
console.log(`https://openlibrary.org/search?${new URLSearchParams({'q': 'isbn:(' + isbnList.join(' OR ') + ')'})}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment