Last active
January 20, 2025 21:51
-
-
Save V-ed/a5d93890ff07e14209c1b82954c38e01 to your computer and use it in GitHub Desktop.
Mealie Add Recipe Bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var recipeUrl = new URL(document.URL); | |
var mealie = "https://mealie.v-ed.ca"; | |
var group_slug = "famille"; | |
var doUseKeywords = false; // use keywords from recipe | |
var stayInEditMode = true; | |
var decoratedUrlParams = { | |
"hellofresh.ca": [ | |
{ | |
param: "locale", | |
value: "fr-CA" | |
} | |
] | |
}; | |
var destUrl = new URL("/g/" + group_slug + "/r/create/url", mealie); | |
if (doUseKeywords) { | |
destUrl.searchParams.set("use_keywords", "1"); | |
} | |
if (stayInEditMode) { | |
destUrl.searchParams.set("edit", "1"); | |
} | |
Object.entries(decoratedUrlParams).forEach(([urlSearchValue, paramsToAdd]) => { | |
if (recipeUrl.href.includes(urlSearchValue)) { | |
paramsToAdd.forEach(({ param, value }) => { | |
recipeUrl.searchParams.append(param, value); | |
}); | |
} | |
}); | |
destUrl.searchParams.set("recipe_import_url", recipeUrl); | |
window.open(destUrl, "_blank"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script to import the current recipe to Mealie
Installation Steps
Go to https://caiorss.github.io/bookmarklet-maker/ and define your bookmarklet title.
Copy the script into the code box, and tweak the variables as needs be.
Press
Generate Bookmarklet
, then drag the blue tagged "Add recipe To Mealie" link to your favorites bar.Usage
On any recipe website, click on the favorite you created as noted above.
You should have a new tab that opens with the recipe being imported, and should automatically move you to the next step depending on your configured vars.
Adapted from the docs' : https://docs.mealie.io/documentation/community-guide/import-recipe-bookmarklet/