diff options
author | elioat <elioat@tilde.institute> | 2022-12-03 12:45:59 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2022-12-03 12:45:59 -0500 |
commit | bd058071de9c2845644984d620fef7b7017a09db (patch) | |
tree | 584afb16beba992cc3e7c11d1c15aad36a46428f /src | |
parent | 91f177c912c7825532fa5ef3efab85d0dd3d9d9b (diff) | |
download | december-2022-bd058071de9c2845644984d620fef7b7017a09db.tar.gz |
slightly restructured to make more general purpose API call
Diffstat (limited to 'src')
-rw-r--r-- | src/pokedex.rkt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pokedex.rkt b/src/pokedex.rkt index 02523b0..38d6ef0 100644 --- a/src/pokedex.rkt +++ b/src/pokedex.rkt @@ -18,12 +18,12 @@ ;; API URL -(define *POKE-API* "https://pokeapi.co/api/v2/pokemon/") +(define *POKE-API* "https://pokeapi.co/api/v2/") (define (get-pokemon id) "queries the api, returns a butt ton of info" - (call/input-url (string->url (~a *POKE-API* id)) ; ~a, like string-append but appends *either* strings or numbers to a string + (call/input-url (string->url (~a *POKE-API* "pokemon/" id)) ; ~a, like string-append but appends *either* strings or numbers to a string get-pure-port (compose string->jsexpr port->string))) ;; QUESTION: could I use read-json here, instead? |