purescript-cookbook
purescript-cookbook copied to clipboard
Cat gif example broken (api key banned)
The two cat gif examples are based on REST api request to giphy.com. The hardcoded key in use is "banned".
https://github.com/JordanMartinez/purescript-cookbook/blob/3bbeca8bfe23d73a5c02d978b1a47286a22df262/recipes/CatGifsReactHooks/src/Main.purs#L72
{
"data": [],
"meta": {
"status": 403,
"msg": "BANNED",
"response_id": ""
}
}
It might work to create a new key and see how long it'll work. Depends on why the key was banned (revoked, because checked in a repository, because too many requests).
Hm, from what I remember, the API key was copied from the elm-lang.org/examples/cat-gifs example. I see that URL (which is linked in the README https://github.com/JordanMartinez/purescript-cookbook/blob/ed4b2c68cda476d1373a56ab177f570c2286f026/recipes/CatGifsReactHooks/README.md?plain=1#L3) now re-directs to a different example for fetching quotes, and the cat GIFs example is missing. Maybe we should just replace the cat GIFs recipes with quotes recipes to keep parity with the Elm examples?
Also, looks like there's a stale comment in the README for that recipe from when it was broken for a different reason 😅 https://github.com/JordanMartinez/purescript-cookbook/blob/ed4b2c68cda476d1373a56ab177f570c2286f026/recipes/CatGifsReactHooks/README.md?plain=1#L5
Maybe we should just replace the cat GIFs recipes with quotes recipes to keep parity with the Elm examples?
It looks like they're hosting the quotes API and blocking cross-origin requests, so maybe we just need to find a free alternative that doesn't require API key / rate-limit requests. Something like https://dog.ceo/dog-api/documentation/random?
Cat gif elm links are broken. They point to quotes example.
Could be a good first contribution if you're up for it @jgarte 🙂 . If not I can probably get around to fixing this sometime over the next couple weeks. Seems like we could just fetch a random dog image from dog.ceo.