getMatchesPaginated

fun getMatchesPaginated(): GoodReadsPaginatedSearchResults

Get the list of matches for the given search query (see searchUrl), paginated.

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 paginatedResults: GoodReadsPaginatedSearchResults = GoodReadsLookup("how time war").getMatchesPaginated()
println("Found ${paginatedResults.totalResults} results across ${paginatedResults.totalPages} pages")
println("Showing only first result of all pages...")
println()

while (paginatedResults.hasNext()) {
    paginatedResults.next().first().let {
        println("page [${paginatedResults.currentPage}] --> \"${it.title}\" by ${it.authorsStr}")
    }
} 
   //sampleEnd
}

Throws

Sources

Link copied to clipboard