WeatherNews.jl/bin/weathernews.jl

20 lines
546 B
Julia
Executable File

#!/usr/bin/env -S julia -O0 --compile=min --color=yes --startup-file=no
using PrettyTables, Printf, TimeZones
using WeatherNews
function main()
zone = localzone()
s = WeatherNews.get_schedule()
pretty_table(s,
header=["caster", "title", "Asia/Tokyo", zone.name, "diff"],
formatters=WeatherNews.fmt)
localtime = now(localzone())
japantime = now(tz"Asia/Tokyo")
@printf "%27s %s\n" "Asia/Tokyo" japantime
@printf "%27s %s\n" zone.name localtime
end
if abspath(PROGRAM_FILE) == @__FILE__
main()
end