Closed Bost closed 4 years ago
That would be useful yes. I guess with the multiple continents, we just have to bite the bullet and assign the continent that makes the most sense (??). Another idea would be to return a comma-separated string of continents, eg: “EUR, ASI”. Performance shouldn’t be that big of an issue, it’s just a simple lookup in a dict.
I've got something for you. It's all countries, not just those hit by the virus. So basically you can download the json files, commit them in your repo as static content... and somebody can start programming against this API from this commit on. And I'll just send you updates when something gets fixed, updated etc.
These are just my preliminary thoughts, I need some hammock time. Anyway I've been thinking about providing a redundant web service serving the same content as you do. That's also one of the reasons why I made web services, instead of just reaching you overs the json files. I'm increasingly of the opinion your service is a crucial element in this whole Corona Dashboard Industry and some redundancy won't hurt anybody.
Redundant implementation - in a different language and a redundant server, too. Yea ok, I see we're both at heroku - maybe we could use another service provider. To avoid having a single point of failure.
But as I said, I need some hammock time...
https://corona-cases-bot.herokuapp.com/ws/dev/codes https://corona-cases-bot.herokuapp.com/ws/dev/names
Edit: and also with two services you can compare their results against each other when doing some tricky refactoring etc.
I've got something for you. It's all countries, not just those hit by the virus. So basically you can download the json files, commit them in your repo as static content... and somebody can start programming against this API from this commit on. And I'll just send you updates when something gets fixed, updated etc.
Seems like an OK solution to me 👍 .
and some redundancy won't hurt anybody.
You are indeed correct.
in a different language and a redundant server, too. Yea ok, I see we're both at heroku - maybe we could use another service provider. To avoid having a single point of failure.
Probably. Heroku was the best and easiest free option I could find (not making any $$$ from this project).
Ups I have a bug there. Worldwide
and ZZ
need to be removed. It is a union of countries. I will fix it.
And I just found out we're rather screwed. In contrary to what I believed, my source - the List_of_sovereign_states_and_dependent_territories_bycontinent(data_file) really assigns following countries to multiple continents:
Oceania and North America:
United States Minor Outlying Islands
Europe and Asia:
Russian Federation
Armenia
Georgia
Cyprus
Turkey
Kazakhstan
Azerbaijan
That's a show stopper for the moment, bloody hell :-(
After some hammocking, I'm increasingly of the following opinion:
If a country can belong to multiple continents then there's no other way around than instead of a new field continent
containing a value of a primitive type, there must continents
type-of list:
"coordinates" : "{…}"
"country" : "Thailand"
"country_code" : "TH"
"continents" : ["ASI" "EUR"] <---- new
Many people will wonder if it's a mistake and may others will make the same mistake (i.e. assuming the one-to-one correspondence). So maybe we should call this field continent-list
to make it clear it's not a mistake. And even better, going one step further - writing in the service description something like "Be aware that continent(s) is a list - see <url>
".
What do you think?
Seems like a good solution! Smart idea to call it continents_list
If there's a need I could implement 3-letter continent codes:
The main complications are:
default-continent-code
i.e. to a non-existing continent.What do you think about that?
I'm trying to work out all the problems at first in clojure in my own project, on the branch continents.