$ show hermanho/MMM-GooglePhotos
MMM-GooglePhotos is a MagicMirrorΒ² module that displays photos from Google Albums on a smart mirror dashboard. It features a clean architecture separating UI logic (MMM-GooglePhotos.js) from backend processing (node_helper.js), with a well-abstracted Google Photos API client (GPhotos.js). The module handles OAuth2 authentication, automatic token refresh, paginated API requests, photo filtering (by date, dimensions, aspect ratio), sorting, and caching to minimize API calls. It supports user interactions via notifications for navigating photos and uploading new images to designated albums.
The LLM identified 3 files worth highlighting for reuse:
A well-crafted Google Photos API wrapper that handles authentication, token refresh, paginated requests, batch operations, and error handling with context preservation. Demonstrates non-obvious skill in managing API rate limits, proper async/await usage, and extracting meaningful error information. Could be reused in any project needing Google Photos integration with minimal modification (primarily replacing internal utility dependencies).
A specialized utility for extracting and formatting detailed error information from Axios HTTP requests. Goes beyond basic error.message to include response data, status codes, headers, and request details when available. Demonstrates skill in handling the varied structure of HTTP error objects. Completely decoupled with zero internal dependencies, making it trivially reusable in any Node.js project that makes HTTP requests.
A correct implementation of the Fisher-Yates shuffle algorithm for randomizing array elements. While simple, this implementation avoids common pitfalls like modulo bias and demonstrates the proper in-place shuffling technique. Zero dependencies and completely self-contained, making it universally reusable in any JavaScript project needing array randomization.