my solution

This commit is contained in:
2026-04-15 20:02:05 -04:00
commit feaf3f0357
10 changed files with 176 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
defmodule Jump do
@base_url "https://wikimedia.org/api/rest_v1"
def fetch(article, start, the_end) do
url = "/metrics/pageviews/per-article/en.wikipedia.org/all-access/user/#{article}/daily/#{start}/#{the_end}"
%{body: %{"items" => items}} = Req.get!(req(), url: url)
items
end
def post(summary) do
Req.post!("https://postman-echo.com/post", body: Jason.encode!(summary))
end
def req do
Req.new(base_url: @base_url)
end
end