Compare commits

...

1 Commits

Author SHA1 Message Date
thread c9bd5207b0 date offset fix & post response detail echo 2026-04-15 21:06:08 -04:00
+13 -5
View File
@@ -14,12 +14,15 @@ defmodule Jump.CLI do
end end
defp fetch(args) do defp fetch(args) do
the_end = Calendar.strftime(DateTime.utc_now(), "%Y%m%d") format = &Calendar.strftime(&1, "%Y%m%d")
now = DateTime.utc_now()
the_end = format.(now)
{the_end_int, ""} = Integer.parse(the_end) {the_end_int, ""} = Integer.parse(the_end)
start = the_end_int - args[:days] start = now |> DateTime.add(-4, :day) |> format.()
Jump.fetch(args[:article], start, the_end) Jump.fetch(args[:article], start, the_end_int)
end end
defp calculate(items, args) do defp calculate(items, args) do
@@ -40,11 +43,16 @@ defmodule Jump.CLI do
end end
defp finish(summary) do defp finish(summary) do
Jump.post(summary) %{status: status, body: %{"data" => data}} = Jump.post(summary)
IO.puts("Summary:")
IO.inspect(summary) IO.inspect(summary)
IO.puts("""
\nPost Response (Status #{status}):
#{inspect(data)}
""")
IO.puts("done.") IO.puts("done.")
end end
end end