adamwight
Seeking early adopters and reviewers of the mediawiki_client library (docs), which intends to wrap all of the major access methods for Wikipedia content.
The supported APIs are functionally complete and the library includes tests. My current goal is to get feedback on the exposed interfaces, and stabilize on an idiomatic Elixir style to begin the 1.x releases.
Examples
Watch all Wikimedia sites and print a link to the next 6 articles as they are created:
Wiki.EventStreams.start_link(streams: "page-create")
Wiki.EventStreams.stream()
|> Stream.take(6)
|> Enum.each(fn event -> IO.puts(event["meta"]["uri"]) end)
# https://www.wikidata.org/wiki/Q111963009
# https://en.wikipedia.org/wiki/Rhinella_xerophylla
# https://fr.wiktionary.org/wiki/stachst_aus
# https://commons.wikimedia.org/wiki/File:St_Swithin,_Quenington_-_Wall_monument_-_geograph.org.uk_-_3514076.jpg
# https://commons.wikimedia.org/wiki/File:Nebria_brevicollis_(Carabidae)_-_(imago),_Henshuisterveld,_the_Netherlands.jpg
# https://commons.wikimedia.org/wiki/Category:Protected_areas_of_Russia/5630230
Get current site statistics for German Wikipedia:
|> Wiki.Site.get!("dewiki")
|> Wiki.Action.new()
|> Wiki.Action.get!(
action: :query,
meta: :siteinfo,
siprop: :statistics
)
# %Wiki.Action.Session{
# ...
# result: %{
# "batchcomplete" => true,
# "query" => %{
# "statistics" => %{
# "activeusers" => 19687,
# "admins" => 188,
# "articles" => 2583285,
# "edits" => 211219883,
# "images" => 130199,
# "jobs" => 0,
# "pages" => 7163473,
# "queued-massmessages" => 0,
# "users" => 3715461
# }
# }
# },
# ...
# }
Fetch all information about Douglas Adams contained on Wikidata:
```elixir
Wiki.Site.get!("wikidatawiki")
|> Wiki.Action.new()
|> Wiki.Action.get!(
action: :wbgetentities,
ids: "Q42"
)
# result: %{
# "entities" => %{
# "Q42" => %{
# "aliases" => %{
# "uk" => [
# %{"language" => "uk", "value" => "Дуглас Ноел Адамс"},
# %{"language" => "uk", "value" => "Адамс Дуглас"}
# ],
# "pt" => [
# %{"language" => "pt", "value" => "Douglas Noël Adams"},
# %{"language" => "pt", "value" => "Douglas Noel Adams"}
# ],
Request ORES scoring for an edit to predict whether it was spam or not:
Wiki.Ores.new("enwiki")
|> Wiki.Ores.request!(
models: ["damaging"],
revids: 456789
)
# %{
# "enwiki" => %{
# "models" => %{
# "damaging" => %{"version" => "0.5.1"}
# },
# "scores" => %{
# "456789" => %{
# "damaging" => %{
# "score" => %{
# "prediction" => false,
# "probability" => %{
# "false" => 0.9784615344695441,
# "true" => 0.021538465530455946
# }
# }
# }
# }
# }
# }
# }
"""
Trending in Announcing
Hey everyone!
Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
Samly can be used to enable SAML 2.0 Single Sign On in a Plug/Phoenix application.
This library uses Erlang esaml to provide
plug enabl...
New
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub.
Docs are at OpenaiEx User Gu...
New
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly.
One of i...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto.
pagination
cursor pagination
sorta...
New
Other Trending Topics
I am seeing a lot of aplications of Argumentum ad Vericundiam in software discussions. They do link some piece of writing and point us to...
New
Hey folks,
I just published a post about Hologram’s funding and where the project goes next - the short version:
Curiosum as Main Spons...
New
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog
It says that Fly is going all-in on sprites, which is a worry ...
New
We’re evaluating API mocking tools for OpenAPI-based projects and would love to hear what other teams are using.
We’re particularly inte...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
I was thinking since Goatmire Elixir turned out pretty good I should maybe do another one. 30th of Sep - 2nd of Oct this year./
The firs...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 3- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
adamwight
I’ve spun out a streaming bzip2 codec as part of the work to support Elixir processing of Wikipedia dumps.
Example usage:
I would have liked to give a fully streamed example, but
:httpcrequires more than a dab of glue to do so, and I can’t find any other currently working library to stream HTTP.adamwight
Since it’s fun, I also decided to upgrade the Server-sent Events listener to use a new Broadway integration, replacing the homespun GenStage relay. The library is already functional but very rough—feedback encouraged! Adam Wight / Off-Broadway Server-sent Events · GitLab
adamwight
Now with Livebook examples.
Also, at day job my team is writing a complementary library to parse wiki article HTML dumps, which works already but will be finalized in a few weeks, then we run it on all available dumps.
We’re looking at article footnotes for our particular use case, but it can be generalized to run whatever other parsing modules.