Skip to content

Recurzion/book-nook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

book-nook 📖

Displays basic StoryGraph API data on a Waveshare epd2in13 display connected to a Raspberry Pi Zero 2 W.

StoryGraph (unfortunately) does not offer an API, and accessing user profile information requires authentication by default. Additionally, StoryGraph is fronted by CloudFlare which creates challenges for automated data collection. This project uses playwright for browser automation to interactively authenticate to StoryGraph and grab the count of books and pages read, then display that data on the e-ink display.

Monochrome picture of a Raspberry Pi Zero 2 W with an e-ink display showing a count of 404 books and 171,739 pages read.

Hardware

The following hardware is required:

  • Raspberry Pi Zero 2 W (an original Pi Zero will not work as playwright uses node which requires arm64 support)
  • A Waveshare epd2in13 e-ink display

Configuration

The following prereqs should be met prior to running book-nook:

  • Waveshare display is connected to your pi's SPI
  • SPI has been enabled using raspi-config -> Interface Options -> SPI
  • chromium has been installed via apt-get install chromium
  • A StoryGraph account has been created for authentication.

Warning

It's advised that you create a separate StoryGraph account just for this purpose instead of using an existing one.

The following environment variables must be set:

SG_EMAIL=<email address used to authenticate to StoryGraph>
SG_PASSWORD=<password used to authenticate to StoryGraph>
SG_TARGET_USER=<StoryGraph user to get book/page data for>

How to Run

book-nook is distributed as a standalone binary compiled for arm64. Simply download the latest binary from the releases page, ensure the above environment variables are set in the current shell, and execute it:

Note

The first time this binary is run, it will install the required playwright dependencies. This may take a few minutes.

./book-nook

2025/12/09 21:33:07 Display found
2025/12/09 21:33:07 Using display of size 122 by 250
2025/12/09 21:33:33 Retrieving data from StoryGraph...
2025/12/09 21:34:05 Navigated to page Sign In | The StoryGraph
2025/12/09 21:34:07 Signing in and waiting for post-login page...
2025/12/09 21:34:44 Page title is <username> - Read Books Stats | The StoryGraph
2025/12/09 21:34:47 Book Count: 404, Page Count: 171,739
2025/12/09 21:34:57 Updating display with data...
2025/12/09 21:35:03 Run finished

You can configure cron to run this binary at an interval of your choosing, for example, every 4 hours:

crontab -e
0 */4 * * * SG_EMAIL=xxx SG_PASSWORD=xxx SG_TARGET_USER=xx /path/to/./book-nook >> /path/to/book-nook.log 

Finishing Touches

If you have access to a 3D printer, I found the following two STL files useful for adding a nice finish to this project (along with a micro-USB cable with a 90° bend in it): Enclosure + Stand

About

Display StoryGraph API data on a epd2in13 display + Pi Zero 2.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors