Compare commits

...

2 Commits

Author SHA1 Message Date
gg 62acd1209e Say that I'm trying to learn Julia 2023-07-28 22:25:34 -07:00
gg 226cedb7f8 Add some docstrings 2023-07-28 22:25:20 -07:00
2 changed files with 10 additions and 0 deletions

View File

@ -2,8 +2,15 @@
Play with data for weather waifus.
## Learning Julia
I've admired Julia from afar for too long. I want to learn how to use this language, so I started
this little project to feel the language out.
## Run
```bash
julia --project -O0 --compile=min bin/weathernews.jl
```
https://rentry.org/faaag

View File

@ -2,8 +2,10 @@ module WeatherNews
using JSON3, HTTP, Dates, TimeZones, DataStructures
"URL for JSON timetable"
SCHEDULE_URL = "https://smtgvs.weathernews.jp/a/solive_timetable/timetable.json"
"Translate Japanese segment titles to short English words."
TITLES = Dict(
"ウェザーニュースLiVE・モーニング" => "Morning",
"ウェザーニュースLiVE・サンシャイン" => "Sunshine",
@ -14,6 +16,7 @@ TITLES = Dict(
"ウェザーニュースLiVE" => "_",
)
"Send a GET Request for `url` and parse the response body as JSON."
function dl(url)
res = HTTP.get(url)
return JSON3.read(res.body)