returned JSON is escaping & so we need to unescape it before fetching#6
returned JSON is escaping & so we need to unescape it before fetching#6NiltonVolpato wants to merge 1 commit into
& so we need to unescape it before fetching#6Conversation
* adds a `json` function to extract simple fields from a json file * handles more error conditions * other small refactorings
|
Hi Nilton, Thanks again for the PR! I wanted to give a bit of context on the image_url extraction and unescaping, just to make sure we’re aligned. Currently, we’re already unescaping \u0026 inline using a simple sed pipe after extracting image_url. This has been working reliably for the current API responses. I noticed your PR wraps this in a reusable json() function, which is neat, but it also adds more sed-based parsing (and some complexity) that might not hold up well for edge cases or more deeply nested structures. Since we’re already relying on predictable top-level keys (image_url, refresh_rate, etc), I think sticking with the current lightweight inline parsing is a bit more robust for our shell environment; and avoids duplicating logic or introducing failure points (e.g., on unexpected whitespace or nesting). Would you be okay reverting the new json() function for now, and keeping the original inline sed usage? If we need richer JSON parsing in future, I think you're on the right path! Really appreciate the contribution; just want to keep it as stable and simple as possible given the constraints of Kindle’s shell. Thanks! |
jsonfunction to extract simple fields from a json file (handling basic unescaping)