thought2 / elm-wikimedia-commons / WikimediaCommons.RandomPictures

A library for working with the WikimediaCommons API


type alias PictureResource =
Internal.PictureResource

Main type of the library, a picture resource from WikiMedia Commons.

getUrl : Basics.Int -> PictureResource -> Maybe Url

Get an Url from a PictureResource if the given width is valid.

getMaxUrl : PictureResource -> Url

Get an Url from a PictureResource pointing to a picture in the largest possible size.

getMaxSize : PictureResource -> ( Basics.Int, Basics.Int )

Get the maximum size in which the resource is available.


type alias Url =
Internal.Url

An URL String

fetchResources : Basics.Int -> Task Http.Error (List PictureResource)

Fetches a number of picture resources from the API.