Wiki Elixir
This project provides unofficial Elixir client modules for Wikipedia and other MediaWiki sites.
Currently supported,
Wiki.Actionto access the Action API. This is a rich set of commands to query or edit almost anything on a wiki.Wiki.EventStreamsto access EventStreams, a real-time feed of events.Wiki.Oresto access the ORES service API, machine-learning models for estimating revision and edit quality.
Considered for a future version,
Everything you'll find here is beta-quality, please suggest improvements. Expect the public interface to change, this project uses semantic versioning and the "0.x" releases should be taken literally.
Installation
Install this package by adding wiki_elixir to your dependencies in mix.exs,
def deps do
[
{:wiki_elixir, "~> 0.1"}
]
end
Documentation is generated with mix docs.
Usage
A simple call to the action API,
Wiki.Action.new("https://de.wikipedia.org/w/api.php")
|> Wiki.Action.get(%{
action: :query,
meta: :siteinfo,
siprop: :statistics
})
|> (&(&1.result)).()
|> IO.inspect()See each module for more detailed examples.
The :format parameter always defaults to :json unless overridden.
Development
The project's homepage is currently on GitLab. To contribute, please submit an issue or a merge request.
The easiest way to run linters is to install the pre-push git hook using,
shell script mix git_hooks.install