~ihabunek/triglav

bc9c6078682446f52946800fda182d1a846cd870 — Ivan Habunek 1 year, 3 months ago 9de8220
Add task to dump zet realtime data
1 files changed, 14 insertions(+), 0 deletions(-)

A lib/mix/tasks/triglav/zet_realtime.ex
A lib/mix/tasks/triglav/zet_realtime.ex => lib/mix/tasks/triglav/zet_realtime.ex +14 -0
@@ 0,0 1,14 @@
defmodule Mix.Tasks.Triglav.ZetRealtime do
  use Mix.Task

  alias Triglav.Zet.Realtime

  @shortdoc "Dump zet realtime data as JSON"

  @impl Mix.Task
  def run(_) do
    Realtime.fetch!()
    |> Protobuf.JSON.encode!()
    |> IO.puts()
  end
end