purescript-cookbook icon indicating copy to clipboard operation
purescript-cookbook copied to clipboard

Cat gif example broken (api key banned)

Open andys8 opened this issue 3 years ago • 3 comments

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).

andys8 avatar Aug 10 '22 17:08 andys8

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?

pete-murphy avatar Aug 10 '22 18:08 pete-murphy

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

pete-murphy avatar Aug 10 '22 18:08 pete-murphy

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?

pete-murphy avatar Aug 10 '22 18:08 pete-murphy

Cat gif elm links are broken. They point to quotes example.

jgarte avatar Oct 27 '22 04:10 jgarte

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.

pete-murphy avatar Nov 01 '22 01:11 pete-murphy