-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I'm trying to import a recipe from one Solid account to another. Changes have been made to the recipe, so I can't just reimport the original website.
I would be ok with adding the remote recipe to the cookbook if it was possible (i.e. one recipe in two cookbooks), but importing is actually preferred in this case.
This was my journey, starting with "Import from the web":
- Importing directly fails with a 401, because it uses an unauthenticated fetch
: await fetch(url); - In principle it seems a Solid resource could be detected with the header
www-authenticate Bearer scope="openid webid" - Workaround is to change the resource to being public
- In principle it seems a Solid resource could be detected with the header
- No recipe is found because parseWebsite expects HTML
- Probably content type would need to be detected, which would then need to be passed to parseWebsite?
await modal.parseWebsite(url, text); - JSON-LD islands are already supported so maybe setting an accept header with "application/ld+json" would be the easiest support route, subsequently with minimal changes in https://github.com/NoelDeMartin/umai/blob/302a2b559c74d65c25ca2c4a7faa28d2c3e8aa2a/src/utils/web-parsing.ts
- Workaround is to manually download JSON-LD
- Probably content type would need to be detected, which would then need to be passed to parseWebsite?
- I used Share -> JSON-LD -> Download and then Upload JSON-LD
- This mostly worked, though images are hotlinked rather than downloaded, so a private image was not available from the new account
- Given this works well, perhaps the same function could be used directly on the remote JSON-LD (without having to download)
const recipe = await Recipe.createFromJsonLD(jsonld);
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request