Support getting artist bios from Wikipedia (experimental)

This commit is contained in:
Claudio Ortolina
2026-02-09 15:19:35 +00:00
parent f82e764c94
commit bcae291cff
23 changed files with 639 additions and 31 deletions
+32
View File
@@ -0,0 +1,32 @@
defmodule Wikipedia.Config do
@type t :: %__MODULE__{
user_agent: String.t(),
req_options: Keyword.t()
}
defstruct user_agent: "change me",
req_options: []
@schema NimbleOptions.new!(
user_agent: [
type: :string,
required: false,
default: "change me"
],
req_options: [
type: :keyword_list,
required: false,
default: []
]
)
@doc NimbleOptions.docs(@schema)
@spec resolve(Application.app()) :: t | no_return
def resolve(otp_app) do
app_config =
Application.get_env(otp_app, Wikipedia)
|> NimbleOptions.validate!(@schema)
struct(__MODULE__, app_config)
end
end