mykle1 / MMM-PetFinder

All types of pets for adoption. Cat, dog, bird, horse, rabbit, reptile, smallfurry, barnyard.
MIT License
1 stars 3 forks source link

Petfinder changed their request format and broke this module #4

Open joseph48nj opened 2 years ago

joseph48nj commented 2 years ago

Looks like they need an API and secret to return a token now. I don't know enough about this code to fix.

https://www.petfinder.com/developers/v2/docs/#request-structure

PhantomOffKanagawa commented 1 year ago

I ran into the same problem and did my best with admittedly rusty OAuth and Request skills to rework it so that it works with the newer API. I'll link the gist I quickly pasted the two changed files (and that you add apiSecret to the magic mirror config file) that should fix the API issue. It is filled with some... mildly ridiculous logging as my sanity was worn down by weird JSON and auth problems, but it should work and when I next have time I'll fork this repo or something to that tune to have a more official solution. I hope its not too late for you but either way... enjoy the fruits of my suffering.

EDIT: I then forgot to link the gist so here: https://gist.github.com/PhantomOffKanagawa/e6bdd3137e3ea9fb2e1b8967b37521fc