Good Reads Metadata
data class GoodReadsMetadata( val title: String, val authors: List<String>, val url: String, val id: String, val isbn: String?, val pages: Int?, val pubDate: LocalDate?) : CompilableToString, Serializable
Content copied to clipboard
Get book metadata from a GoodReads details page, a GoodReads ID or title/author.
Samples
import ch.derlin.grmetafetcher.GoodReadsLookup
import ch.derlin.grmetafetcher.GoodReadsMetadata
import ch.derlin.grmetafetcher.GoodReadsPaginatedSearchResults
import ch.derlin.grmetafetcher.Retry
import ch.derlin.grmetafetcher.RetryConfiguration
fun main() {
//sampleStart
val p: (GoodReadsMetadata) -> Unit = { println(it.toCompilableString()) }
// very shot titles need authors to match
p(GoodReadsMetadata.lookup(title = "substance", author = "claro"))
// Authors will match without the initials, and can be ignored in search for specific/long enough titles
p(GoodReadsMetadata.lookup("House of Leaves", "Mark Danielewski", includeAuthorInSearch = false))
// Subtitle can be ignored in lookup
p(GoodReadsMetadata.lookup(title = "Masters of Doom"))
// The same can be achieved using GoodReadsLookup // accents don't matter
p(GoodReadsLookup(title = "la cle de salomon").findBestMatch().getMetadata())
// If you know the URL or GoodReads ID, you can use them directly
p(GoodReadsMetadata.fromGoodReadsId("41940388"))
//sampleEnd
}
Constructors
Types
Functions
Link copied to clipboard
Should return the String representation of this class as a compilable snippet (can be copy-pasted into Kotlin code).
Properties
Link copied to clipboard
Link copied to clipboard
The URL of the book on GoodReads. Note that it can also be reconstructed from the id, using GoodReadsUrl.forBookId.