Seems like they could cut out a lot of that code by using macros. Here's a quick and dirty Common Lisp script that reads the CSVs from the .zip file and generates classes at runtime using the headers in each CSV for the slot names. It also defines a 'select' function to make queries easy to write. It's a little too long to post here:
Neat! I can't find anything in Clojure that does that, so I guess I'd have to use java.util.zip via Clojure ineterop. But making records and doing queries is easy:
> generate classes at runtime using the headers in each CSV
Fun project! I also used Clojure for a transit status project - calling the REST API of my local bike share system to display how many bikes were in the nearest station. Clojure is great for exploring and transforming that kind of data.
One small tip for the author: clojure.data.csv would simplify csv handling. Its readme includes a simple routine to transform the data to maps.
Author here, thank you for the comment, you're right in the latest code I replaced it with clojure.data.csv but for the article I kept it that way to show that you don't need dependencies for such little utilities, split, map and zipmap and we're done.
I made it so I could ask "where's the nearest Jump bike?" in Sacramento. At some point the API stopped working, but, after checking today, it was just the URLs of the updated feeds had changed (the old ones still 200 with no actual data) so I think I've managed to fix it.
Unfortunately, Jump shut down in Sacramento because of Corona virus!
Overall, it only works OK. When Apple Shortcuts requests GPS location, it doesn't just return the GPS, it makes a HTTP call to get the street info, which isn't needed here and slows things down. Then the gbfs.uber.com API is very slow... as though they don't cache at all, whereas I thought they only refreshed once/minute: https://gbfs.uber.com/v1/sacb/station_information.json
From the title, my mind was primed to think this was related to Transit, which is (primarily) a Clojure standard for sending Clojure data structures back and forth between frontend and backend: https://github.com/cognitect/transit-format
It's cool to see some practical Clojure examples on hacker news.
https://gist.github.com/jl2/fd324fa3faa919803152465fade14b6b
And here's what it looks like to use it: