From 118b977457c8cb80edd0344fbf2679d2cdbd50d7 Mon Sep 17 00:00:00 2001 From: Ellis Valentiner Date: Sat, 24 Mar 2018 22:05:37 -0400 Subject: [PATCH 1/3] Time machine request did not contain the time component --- src/DarkSky.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DarkSky.jl b/src/DarkSky.jl index 9fa2923..826bbd5 100644 --- a/src/DarkSky.jl +++ b/src/DarkSky.jl @@ -95,7 +95,7 @@ function forecast(latitude::Float64, longitude::Float64, time::DateTime; verbose exclude::Optional{Array{String}}=nothing, lang::String="en", units::String="us") @argcheck in(lang, SUPPORTED_LANGS) @argcheck in(units, SUPPORTED_UNITS) - url = "https://api.darksky.net/forecast/$(ENV["DARKSKY_API_KEY"])/$latitude,$longitude?lang=$lang&units=$units" + url = "https://api.darksky.net/forecast/$(ENV["DARKSKY_API_KEY"])/$latitude,$longitude,$time?lang=$lang&units=$units" if !(exclude === nothing) url = "$url&exclude=$(join(exclude, ","))" end From 3802b808c23dbd0a06c412afcb2426b3cab00b00 Mon Sep 17 00:00:00 2001 From: Ellis Valentiner Date: Sat, 24 Mar 2018 22:36:56 -0400 Subject: [PATCH 2/3] reduce print --- src/DarkSky.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DarkSky.jl b/src/DarkSky.jl index 826bbd5..9329df1 100644 --- a/src/DarkSky.jl +++ b/src/DarkSky.jl @@ -28,7 +28,7 @@ end DarkSkyResponse(x::Dict) = DarkSkyResponse((get.(x, String.(fieldnames(DarkSkyResponse)), nothing))...) function Base.show(io::IO, x::DarkSkyResponse) - print(io, (x.latitude, x.longitude), "\n" * x.daily["summary"]) + print(io, (x.latitude, x.longitude)) end for fieldname in fieldnames(DarkSkyResponse) From fa308ff280bf485c22a0a735b4827fccc7d99a1a Mon Sep 17 00:00:00 2001 From: Ellis Valentiner Date: Sat, 24 Mar 2018 22:38:07 -0400 Subject: [PATCH 3/3] Add "test" for print --- test/runtests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/runtests.jl b/test/runtests.jl index cc1a8d5..a06b21c 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -15,6 +15,7 @@ if haskey(ENV, "DARKSKY_API_KEY") @test isa(daily(response), Dict{String, Any}) @test isa(alerts(response), Array{Any, 1}) | isa(alerts(response), Void) @test isa(flags(response), Dict{String, Any}) + @test isa(print(response), Void) @test isa(forecast(42.3601, -71.0589, DateTime(2018, 1, 1, 0, 0, 0), lang="es", units="si", exclude=["minutely"]), DarkSky.DarkSkyResponse) else warn("Dark Sky API key was not found in your system environment variables, skipping tests...")