Ignore empty recipes

This commit is contained in:
Nicholas Jitkoff 2022-12-22 20:07:22 -08:00
parent 59b690be6c
commit b096529704
2 changed files with 3 additions and 1 deletions

View file

@ -204,7 +204,7 @@
el("div", {}, error),
el("form", {method: "dialog"},
el("button", {onclick:history.back.bind(history)}, "Learn More"),
el("button", {onclick:() => location.href = "https://parse.bitty.site"}, "Learn More"),
el("button", {onclick:history.back.bind(history)}, "Go Back")));
document.body.appendChild(dialog)
dialog.showModal();

View file

@ -126,6 +126,8 @@ let scrapeRecipe = async document => {
let recipe = findLDJsonRecipe(doc) || findMicrodataRecipe(doc) || await scrapeRecipe(doc);
if (!recipe.recipeInstructions) recipe = undefined;
if (recipe) {
let url = doc.evaluate('//meta[@property="og:url"]/@content', doc, null, XPathResult.STRING_TYPE)?.stringValue;