Skip to content

feat: Add Currently Reading Book Widget (#57)#61

Open
Sneha-0409 wants to merge 3 commits into
cu-sanjay:mainfrom
Sneha-0409:new-feature-branch
Open

feat: Add Currently Reading Book Widget (#57)#61
Sneha-0409 wants to merge 3 commits into
cu-sanjay:mainfrom
Sneha-0409:new-feature-branch

Conversation

@Sneha-0409

@Sneha-0409 Sneha-0409 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Closes #57

Overview of my PR

This PR introduces the Currently Reading book widget, allowing users to dynamically showcase the books they are actively reading on their GitHub READMEs without relying on manual updates.

Features Added

  • Goodreads Integration: Uses the public Goodreads RSS feed (/review/list_rss/) to securely query a user's shelf.
  • Zero-Dependency XML Parser: Created a custom fetchText utility and a regex-based XML parser directly within Node.js native http/https. This ensures the project maintains its zero-dependency philosophy!
  • Dynamic Cover Loading: The system extracts the book cover image URL, downloads the binary payload, and converts it into a Base64-encoded string natively so it easily embeds inside the SVG.
  • Shelf Control: Users can toggle between displaying currently-reading, read, or to-read shelves.
  • Frontend Addition: The "Currently Reading" preset was added to index.html allowing visual customization and previews.

UI

Screenshot 2026-06-08 at 11 52 09 Screenshot 2026-06-08 at 11 52 26

Performance & Caching

  • Configured via standard cache headers inside api/widget.js.
  • Caches for 1 hour (s-maxage=3600, max-age=3600). This is a relatively slow-updating metric, so the 1-hour buffer is highly efficient and guarantees we do not get rate-limited by Goodreads.

Testing Done

  • Tested the native Regex logic; successfully parses title, author, and handles CDATA segments dynamically.
  • Gracefully handles Edge Cases: If a user has no book currently on their shelf, or if the cover image is missing, the SVG defaults to a cleanly-styled placeholder book outline.
  • Tested all visual variables (Theme, Platform, Status) locally using the control panel generator.

@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

@Sneha-0409 is attempting to deploy a commit to the SanZ's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timeinreadme Ready Ready Preview, Comment Jun 10, 2026 3:20pm

@cu-sanjay cu-sanjay added NSOC Accepted Indicates the issue/PR has been accepted under NSOC guidelines. NSoC'26 General contributions submitted by participants. level3 NSoC 2026 Contribution Level 3. labels Jun 8, 2026
@cu-sanjay

Copy link
Copy Markdown
Owner

Heyy... looks like conflicts from both your PRs caused an issue; I tried merging both but doesn't seem right. Please update the repo to the latest version and clean changes, or take a look into it when you can. @Sneha-0409

@Sneha-0409

Copy link
Copy Markdown
Contributor Author

@cu-sanjay sure I'll look into it

@Sneha-0409

Copy link
Copy Markdown
Contributor Author

@cu-sanjay hey I have fixed the conflicts, check out and do let me know if it's still present I'll fix it again!

@vercel vercel Bot requested a deployment to Preview June 10, 2026 15:20 Abandoned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level3 NSoC 2026 Contribution Level 3. NSOC Accepted Indicates the issue/PR has been accepted under NSOC guidelines. NSoC'26 General contributions submitted by participants.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add "Currently Reading" Book Widget

2 participants