Are you spending too much time manually updating your website with available pets? Thanks to Save SomeBunny rescue, I have a solution for you!
Save SomeBunny volunteers, Jess and Jamie, realized they were losing valuable time updating their website and adoption sites that could be better spent taking care of rabbits. So, they used the Pawlytics API to create a beautiful and elegant solution to display available rabbits on their website that is automatically updated by their Pawlytics database.
Jamie and Jess both have a background in technology. Jess is the founder of Menidae, a web development and graphic design agency. Jamie is a tech artist in the game industry. I’m going to go ahead and give a heads up to the non-technical people reading this, as I am one of you 😉. I am relaying how to do this from Jess and Jamie, so you may want to go ahead and forward this blog to your development, technical, and/or programming team members! They’ll know what to do! 😁
Jess has placed the code into a public Github for the WordPress puzzle pieces. She noted, the only thing required for this code is a response.json that is publicly accessible. Jess used the Ruby scrip by Pawlytics (linked here) to write her own Python script(s), they are run using cron and bash on the hour.
Read below for an explanation of the integration from Jess at Save SomeBunny:
- Pet ID
- Pet Name
- Pet Estimated Birth Date
- Pet Weight Lbs
- Pet Gender
- Pet Images
- Pet Description
In this file, we process the data in a way that suits us — For example, grabbing only the first image from the pet images provided by Pawlytics. With each item from the above list, there was something different we wanted to do. Because of this, it’s important that anyone using this code carefully read the functionality and change it to suit their needs. We have three sizes for bunnies, for example, that are very different to the sizes needed for dogs. We also display the gender ‘Other’ as ‘Undetermined.’ As you can see, they are implementation-specific.
Finally, the code creates the elements visible to the user right on the spot in the Gallery Page. If all of the files provided in the repository are pasted on to the Gallery Page in the order recommended in bunnies.html, alongside some changes to the URLs (such as the link for ‘Adopt’), implementation-specific changes to bunny.js, the code should be able to work its magic and generate a gallery!
- It’s doesn’t create pages for each pet, only displays a popup containing the description and an adoption link, as seen below.
- It also might become very slow if there are many pets. In this case, pagination would be advised.
- It expects a secure connection (https).
- Confidence in working with web servers is recommended for interfacing with the Pawlytics API and generating the response.json file needed for this to function
- And I would be remiss if I didn’t point out — The previously mentioned response.json should not include Pawlytics API credentials. That should be handled server-sid and stored in a file that is not publicly accessible. In the future, I hope to add our Python script for anyone to use as guidance.
Thank you, Jess and Jamie! We are SO impressed and thankful to both of you and Save SomeBunny for sharing this with us. We hope this helps save other organizations time while giving potential adopters a beautiful view of pets waiting for their furever home.
If you try this out for your rescue, send us your webpages to be featured!