Compare commits
1 Commits
a8eab3c9c8
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| da0b553f64 |
@@ -17,3 +17,5 @@ Generated escript jump with MIX_ENV=dev
|
|||||||
}
|
}
|
||||||
done.
|
done.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note: I noticed a couple things after my rush to submit: https://git.impulsedetroit.net/thread/jump/pulls/2
|
||||||
+5
-11
@@ -14,11 +14,10 @@ defmodule Jump.CLI do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp fetch(args) do
|
defp fetch(args) do
|
||||||
format = &Calendar.strftime(&1, "%Y%m%d")
|
the_end = Calendar.strftime(DateTime.utc_now(), "%Y%m%d")
|
||||||
|
{the_end_int, ""} = Integer.parse(the_end)
|
||||||
|
|
||||||
now = DateTime.utc_now()
|
start = the_end_int - args[:days]
|
||||||
the_end = format.(now)
|
|
||||||
start = now |> DateTime.add(-4, :day) |> format.()
|
|
||||||
|
|
||||||
Jump.fetch(args[:article], start, the_end)
|
Jump.fetch(args[:article], start, the_end)
|
||||||
end
|
end
|
||||||
@@ -41,16 +40,11 @@ defmodule Jump.CLI do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp finish(summary) do
|
defp finish(summary) do
|
||||||
%{status: status, body: %{"data" => data}} = Jump.post(summary)
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user