Lastex.Page (Lastex v0.1.0)

Copy Markdown View Source

Pagination wrapper for Last.fm list endpoints.

Summary

Functions

Builds a Page from a standard list response.

Builds a Page from a search response.

Functions

from_response(error, arg2)

Builds a Page from a standard list response.

Takes {wrapper_key, data_path} where data_path is a string key or list of string keys to extract the data list from within the wrapper.

Pagination fields are parsed from wrapper["@attr"].

from_search_response(error, arg2)

Builds a Page from a search response.

Search responses nest data under results > matches_key > data_key and store pagination in opensearch fields at the results level.