Packages
API client library for any MediaWiki-based site, such as Wikipedia or Wikimedia Commons. Provides the Action API, realtime feed ingestion, and ORES scoring.
Current section
Files
Jump to
Current section
Files
lib/util.ex
defmodule Wiki.Util do
@moduledoc false
@version Mix.Project.config()[:version]
@doc false
@spec default_adapter() :: atom
def default_adapter do
Application.get_env(:mediawiki_client, :tesla_adapter, Tesla.Adapter.Hackney)
end
@doc false
@spec user_agent() :: String.t()
def user_agent do
# TODO: Is there a way to use Elixir.MixProject.project()[:version]?
Application.get_env(
:mediawiki_client,
:user_agent,
"mediawiki_client_ex/#{@version} (spam@ludd.net)"
)
end
end
defmodule Wiki.Error do
@moduledoc false
# TODO: more nuanced error types that can be matched by consumers.
@doc false
defexception [:message]
end