Lessons from my Book Search Tool
I recently built myself a book search tool and I learned a lot in the process.
Notes
Jul 7, 2023
1 min read
Recently, I built a web app for personal use that allows me to query the Google Book Search API and then send results to my Notion Book database. The book cover images that Google sends back are small and ugly so they looked blown up and pixelated once they arrived in Notion.
So, I thought… I bet I could whip up an image service that takes that original image from Google, finds the dominant color used in the image to create a colorful background and exports a new image… WRONG.
A week later and after probably over 5 hours of research and coding I did finally find a solution and my Notion Book database looks beautiful, but I learned a LOT in the process:
- Images are complex in javascript. PHP is made to handle image files and can easily take a raw image file and process it through a multi-part form. Node.js is not PHP. I had to learn about image blobs, buffers and base64 encoded strings in order to attempt to upload an image to a file server. Ultimately I never could PUT files on a server.
- I did find that there are some excellent screenshot APIs that can handle a lot of the complexity. I used one called ScreenshotOne. I built a separate page with a 640 by 340 image on it and used the service to make an image of my code. This is what I reference as the cover image in Notion.
I learn so much from personal projects like these. They’re fun because I have the drive and passion to solve a complex problem for myself and I stress test my javascript knowledge along the way.