dotcom icon indicating copy to clipboard operation
dotcom copied to clipboard

Improve expressiveness of the API

Open catalandres opened this issue 9 years ago • 0 comments

As I was trying to document the API for convert (#19) I started to think that it may have too many parameters (I was testing what happens when a parameter is missing and it's kind of a mess) and is overall not very expressive (i.e. readable).

Instead of

http://www.hebcal.com/converter/?cfg=json&gy=2011&gm=6&gd=2&g2h=1 http://www.hebcal.com/converter/?cfg=json&hy=5749&hm=Kislev&hd=25&h2g=1

it could be something like

http://www.hebcal.com/convertDate/toHebrew/?date=2011-06-02&output=json http://www.hebcal.com/convertDate/toGregorian/?date="5749-Kislev-25&output=json

It's not much longer, and it's way easier to parse by humans. :)

catalandres avatar Apr 15 '16 15:04 catalandres