Posted by thimabi 4 days ago
> Each of the seven sections on the image represents a browser tab that Puppeteer needs to keep open in order to fetch screenshots. Remember that the Node.js server was running on a Raspberry Pi, it didn’t have an excess of memory to operate in and Chrome is not known for its svelte-ness.
> I picked Node.js for the first server because I was using Puppeteer. I don’t particularly like Javascript, so given the ability to start from scratch I happily pivoted to Rust.
> Next, since we’re not relying on a browser engine to render the display, we will be using a 2D graphics library to render a PNG directly. This should have a much lower resource cost than using an entire browser engine, at the cost of some decreased flexibility.
> Each of the seven sections on the image represents a browser tab that Puppeteer needs to keep open in order to fetch screenshots. Remember that the Node.js server was running on a Raspberry Pi, it didn’t have an excess of memory to operate in and Chrome is not known for its svelte-ness.
So then figuring they had to effectively redo it from scratch with a new solution, they then switched over to a language and stack they enjoyed, which seems completely reasonable.
> I picked Node.js for the first server because I was using Puppeteer. I don’t particularly like Javascript, so given the ability to start from scratch I happily pivoted to Rust.
edit: Just beaten and directly from the author it seems. :)
> like most truly useful things we need to build it ourselves
but I was surprised that the author insists on displaying an image on the Kindle. The last third of the post is dedicated to building that PNG file. Is it possible to send text? It would be easier but maybe it's not possible...?
I plotted bus locations in matplotlib, which was what I knew at the time.
The busses would clump up where I lived, so it was helpful to know if I should rush breakfast to catch a burst of busses or just wait for the next wave.
I also didn't know that skia had rust bindings and it seemed pretty easy to setup.
It's been a nightmare to try setup in c++.
If anything goes wrong with a train journey I find it useful to have as much information as possible.