diff --git a/README.md b/README.md index 78803a5..94fa1f6 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ Depending on the recipe, certain fields may be left blank. All fields are repres ingredients: [], instructions: [], servings: "", + image: "", time: { prep: "", cook: "", diff --git a/helpers/puppeteerFetch.js b/helpers/puppeteerFetch.js index 46d3d61..9162f96 100644 --- a/helpers/puppeteerFetch.js +++ b/helpers/puppeteerFetch.js @@ -61,13 +61,15 @@ const puppeteerFetch = async url => { let html = await page.content(); try { await browser.close(); - } catch (error) {} // avoid websocket error if browser already closed - return html; + } finally { + return html; + } // avoid websocket error if browser already closed } else { try { await browser.close(); - } catch (error) {} - return Promise.reject(response._status); + } finally { + return Promise.reject(response._status); + } } }; diff --git a/helpers/recipe-schema.js b/helpers/recipe-schema.js index 49b8095..dacac2e 100644 --- a/helpers/recipe-schema.js +++ b/helpers/recipe-schema.js @@ -11,6 +11,7 @@ function Recipe() { total: "" }; this.servings = ""; + this.image = ""; } module.exports = Recipe; diff --git a/package.json b/package.json index 4920c52..5b2c5ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "recipe-scraper", - "version": "1.14.1", + "version": "1.15.0", "description": "A JS package for scraping recipes from the web.", "author": "Justin Adkins ", "license": "MIT", diff --git a/scrapers/101cookbooks.js b/scrapers/101cookbooks.js index aeec88f..bdca857 100644 --- a/scrapers/101cookbooks.js +++ b/scrapers/101cookbooks.js @@ -14,6 +14,7 @@ const oneHundredAndOne = url => { const $ = cheerio.load(html); const body = $(".wprm-recipe-container"); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = body.children("h2").text(); $(".wprm-recipe-ingredient").each((i, el) => { diff --git a/scrapers/allrecipes.js b/scrapers/allrecipes.js index 61e7d4b..ce7b8e8 100644 --- a/scrapers/allrecipes.js +++ b/scrapers/allrecipes.js @@ -30,6 +30,7 @@ const allRecipes = url => { }; const newAllRecipes = ($, Recipe) => { + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = Recipe.name.replace(/\s\s+/g, ""); $(".recipe-meta-item").each((i, el) => { @@ -76,6 +77,8 @@ const newAllRecipes = ($, Recipe) => { }; const oldAllRecipes = ($, Recipe) => { + Recipe.image = $("meta[property='og:image']").attr("content"); + $("#polaris-app label").each((i, el) => { const item = $(el) .text() diff --git a/scrapers/ambitiouskitchen.js b/scrapers/ambitiouskitchen.js index e192bef..a99776c 100644 --- a/scrapers/ambitiouskitchen.js +++ b/scrapers/ambitiouskitchen.js @@ -13,6 +13,7 @@ const ambitiousKitchen = url => { const Recipe = new RecipeSchema(); const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".wprm-recipe-name").text(); $(".wprm-recipe-ingredient").each((i, el) => { diff --git a/scrapers/bbc.js b/scrapers/bbc.js index def9e43..3775718 100644 --- a/scrapers/bbc.js +++ b/scrapers/bbc.js @@ -13,6 +13,7 @@ const bbc = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".content-title__text").text(); $(".recipe-ingredients__list-item").each((i, el) => { diff --git a/scrapers/bbcgoodfood.js b/scrapers/bbcgoodfood.js index c25ef75..713a9c5 100644 --- a/scrapers/bbcgoodfood.js +++ b/scrapers/bbcgoodfood.js @@ -13,6 +13,7 @@ const bbcGoodFood = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe-header__title").text(); $(".ingredients-list__item").each((i, el) => { diff --git a/scrapers/bonappetit.js b/scrapers/bonappetit.js index 1ecc165..d340bf4 100644 --- a/scrapers/bonappetit.js +++ b/scrapers/bonappetit.js @@ -13,6 +13,7 @@ const bonAppetit = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $("a.top-anchor").text(); $(".ingredients") diff --git a/scrapers/budgetbytes.js b/scrapers/budgetbytes.js index 29ea2d1..902c131 100644 --- a/scrapers/budgetbytes.js +++ b/scrapers/budgetbytes.js @@ -13,6 +13,7 @@ const budgetBytes = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".wprm-recipe-name").text(); $(".wprm-recipe-ingredient-notes").remove(); diff --git a/scrapers/closetcooking.js b/scrapers/closetcooking.js index 71d3dfc..761935c 100644 --- a/scrapers/closetcooking.js +++ b/scrapers/closetcooking.js @@ -13,6 +13,7 @@ const closetCooking = url => { const Recipe = new RecipeSchema(); const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe_title").text(); $(".ingredients") diff --git a/scrapers/cookieandkate.js b/scrapers/cookieandkate.js index 51902b3..af59856 100644 --- a/scrapers/cookieandkate.js +++ b/scrapers/cookieandkate.js @@ -13,6 +13,7 @@ const cookieAndKate = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".tasty-recipes") .children("h2") .text(); diff --git a/scrapers/copykat.js b/scrapers/copykat.js index bbf099b..1d82b82 100644 --- a/scrapers/copykat.js +++ b/scrapers/copykat.js @@ -13,6 +13,7 @@ const copykat = url => { var Recipe = new RecipeSchema(); const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $( $(".wprm-recipe-container").find(".wprm-recipe-name") ).text(); diff --git a/scrapers/damndelicious.js b/scrapers/damndelicious.js index 07845fc..c8aedf3 100644 --- a/scrapers/damndelicious.js +++ b/scrapers/damndelicious.js @@ -15,6 +15,7 @@ const damnDelicious = url => { let titleDiv = $(".recipe-title"); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(titleDiv) .children("h2") .text(); diff --git a/scrapers/eatingwell.js b/scrapers/eatingwell.js index 03792d6..62147f3 100644 --- a/scrapers/eatingwell.js +++ b/scrapers/eatingwell.js @@ -13,6 +13,7 @@ const eatingWell = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".main-header") .find(".headline") .text() diff --git a/scrapers/epicurious.js b/scrapers/epicurious.js index d438e8a..d02f291 100644 --- a/scrapers/epicurious.js +++ b/scrapers/epicurious.js @@ -13,6 +13,7 @@ const epicurious = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $("h1[itemprop=name]") .text() .trim(); diff --git a/scrapers/finecooking.js b/scrapers/finecooking.js index 39945e3..7aa8b0b 100644 --- a/scrapers/finecooking.js +++ b/scrapers/finecooking.js @@ -13,6 +13,7 @@ const fineCooking = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe__title").text(); $(".recipe__nutrition").remove(); diff --git a/scrapers/food.js b/scrapers/food.js index 56cca83..b101d93 100644 --- a/scrapers/food.js +++ b/scrapers/food.js @@ -13,6 +13,7 @@ const food = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[name='og:image']").attr("content"); Recipe.name = $(".recipe-title").text(); $(".recipe-ingredients__item").each((i, el) => { diff --git a/scrapers/foodandwine.js b/scrapers/foodandwine.js index 39f5b64..a2a5f84 100644 --- a/scrapers/foodandwine.js +++ b/scrapers/foodandwine.js @@ -13,6 +13,7 @@ const foodAndWine = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $("h1.headline").text(); $(".ingredients") diff --git a/scrapers/foodnetwork.js b/scrapers/foodnetwork.js index 9d9590c..f8f957b 100644 --- a/scrapers/foodnetwork.js +++ b/scrapers/foodnetwork.js @@ -13,9 +13,11 @@ const foodNetwork = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".o-AssetTitle__a-HeadlineText") .first() .text(); + $(".o-Ingredients__a-Ingredient, .o-Ingredients__a-SubHeadline").each( (i, el) => { const item = $(el) diff --git a/scrapers/gimmesomeoven.js b/scrapers/gimmesomeoven.js index 140a109..86ea004 100644 --- a/scrapers/gimmesomeoven.js +++ b/scrapers/gimmesomeoven.js @@ -13,6 +13,7 @@ const gimmeSomeOven = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".tasty-recipes-header-content") .children("h2") .first() diff --git a/scrapers/kitchenstories.js b/scrapers/kitchenstories.js index a8deeca..900892d 100644 --- a/scrapers/kitchenstories.js +++ b/scrapers/kitchenstories.js @@ -20,6 +20,7 @@ const kitchenStories = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe-title").text(); $(".ingredients") diff --git a/scrapers/myrecipes.js b/scrapers/myrecipes.js index 1d61c78..7476ce4 100644 --- a/scrapers/myrecipes.js +++ b/scrapers/myrecipes.js @@ -13,6 +13,7 @@ const myRecipes = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $("h1.headline") .text() .trim(); diff --git a/scrapers/seriouseats.js b/scrapers/seriouseats.js index 5e99b3d..d47f29f 100644 --- a/scrapers/seriouseats.js +++ b/scrapers/seriouseats.js @@ -39,6 +39,7 @@ const seriousEats = url => { }; const regularRecipe = ($, Recipe) => { + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe-title") .text() .replace(/\s\s+/g, ""); diff --git a/scrapers/simplyrecipes.js b/scrapers/simplyrecipes.js index ed465b2..2e04bff 100644 --- a/scrapers/simplyrecipes.js +++ b/scrapers/simplyrecipes.js @@ -15,6 +15,7 @@ const simplyRecipes = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe-callout") .children("h2") .text(); diff --git a/scrapers/smittenkitchen.js b/scrapers/smittenkitchen.js index f3bf7ae..008ce58 100644 --- a/scrapers/smittenkitchen.js +++ b/scrapers/smittenkitchen.js @@ -42,6 +42,7 @@ const oldSmitten = ($, Recipe) => { let servingWords = ["Yield", "Serve", "Servings"]; let servingsRegex = new RegExp(servingWords.join("|"), "i"); + Recipe.image = $("meta[property='og:image']").attr("content"); body.each((i, el) => { if (i === 0) { Recipe.name = $(el) @@ -84,6 +85,7 @@ const oldSmitten = ($, Recipe) => { }; const newSmitten = ($, Recipe) => { + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".jetpack-recipe-title").text(); $(".jetpack-recipe-ingredients") diff --git a/scrapers/thepioneerwoman.js b/scrapers/thepioneerwoman.js index ac41122..79bd00e 100644 --- a/scrapers/thepioneerwoman.js +++ b/scrapers/thepioneerwoman.js @@ -15,6 +15,7 @@ const thePioneerWoman = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe-title") .first() .text(); diff --git a/scrapers/therealfoodrds.js b/scrapers/therealfoodrds.js index a335f3d..c35018f 100644 --- a/scrapers/therealfoodrds.js +++ b/scrapers/therealfoodrds.js @@ -15,6 +15,7 @@ const theRealFoodRds = url => { const Recipe = new RecipeSchema(); const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".tasty-recipes-entry-header") .children("h2") .first() diff --git a/scrapers/thespruceeats.js b/scrapers/thespruceeats.js index 7a35fae..a4eb7c0 100644 --- a/scrapers/thespruceeats.js +++ b/scrapers/thespruceeats.js @@ -13,6 +13,7 @@ const theSpruceEats = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".heading__title").text(); $(".simple-list__item").each((i, el) => { diff --git a/scrapers/whatsgabycooking.js b/scrapers/whatsgabycooking.js index 16bd14f..9286fe7 100644 --- a/scrapers/whatsgabycooking.js +++ b/scrapers/whatsgabycooking.js @@ -13,6 +13,7 @@ const whatsGabyCooking = url => { if (!error && response.statusCode === 200) { const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe-header").text(); $(".wprm-recipe-ingredient").each((i, el) => { diff --git a/scrapers/woolworths.js b/scrapers/woolworths.js index 8412647..18225ca 100644 --- a/scrapers/woolworths.js +++ b/scrapers/woolworths.js @@ -1,4 +1,5 @@ const request = require("request"); +const cheerio = require("cheerio"); const RecipeSchema = require("../helpers/recipe-schema"); @@ -25,17 +26,20 @@ const woolworths = url => { url: recipeJsonUrl, json: true }, - (error, response, body) => { - if (!error && response.statusCode === 200 && body) { - Recipe.name = body.Title.trim(); - Recipe.ingredients = body.Ingredients.map(i => + (error, response, html) => { + if (!error && response.statusCode === 200 && html) { + const $ = cheerio.load(html); + + Recipe.image = $("meta[property='og:image']").attr("content"); + Recipe.name = html.Title.trim(); + Recipe.ingredients = html.Ingredients.map(i => i.Description.trim() ); - Recipe.time.prep = body.PreparationDuration.toString(); - Recipe.time.cook = body.CookingDuration.toString(); - Recipe.servings = body.Servings.toString(); + Recipe.time.prep = html.PreparationDuration.toString(); + Recipe.time.cook = html.CookingDuration.toString(); + Recipe.servings = html.Servings.toString(); Recipe.instructions = []; - body.Instructions.split("\r\n").map(step => { + html.Instructions.split("\r\n").map(step => { if (instructionsIndexRe.test(step)) { Recipe.instructions.push( instructionsIndexRe.exec(step)[1].trim() diff --git a/scrapers/yummly.js b/scrapers/yummly.js index f7b1359..36e990a 100644 --- a/scrapers/yummly.js +++ b/scrapers/yummly.js @@ -94,6 +94,7 @@ const yummy = url => { const Recipe = new RecipeSchema(); const $ = cheerio.load(html); + Recipe.image = $("meta[property='og:image']").attr("content"); Recipe.name = $(".recipe-title").text(); $(".IngredientLine").each((i, el) => { diff --git a/test/constants/101cookbooksConstants.js b/test/constants/101cookbooksConstants.js index 15f2040..133d131 100644 --- a/test/constants/101cookbooksConstants.js +++ b/test/constants/101cookbooksConstants.js @@ -32,6 +32,7 @@ module.exports = { ready: "", total: "15 mins" }, - servings: "8" + servings: "8", + image: "https://images.101cookbooks.com/coleslaw-recipe-h.jpg?w=680" } }; diff --git a/test/constants/allRecipesConstants.js b/test/constants/allRecipesConstants.js index be5e636..ccb6638 100644 --- a/test/constants/allRecipesConstants.js +++ b/test/constants/allRecipesConstants.js @@ -29,7 +29,8 @@ module.exports = { ready: "25 m", total: "" }, - servings: "6" + servings: "6", + image: "https://images.media-allrecipes.com/userphotos/560x315/2253389.jpg" }, expectedRecipeNew: { name: "Crispy and Tender Baked Chicken Thighs", @@ -57,6 +58,8 @@ module.exports = { ready: "", total: "1 hr 10 mins" }, - servings: "8" + servings: "8", + image: + "https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fimages.media-allrecipes.com%2Fuserphotos%2F1061355.jpg" } }; diff --git a/test/constants/ambitiouskitchenConstants.js b/test/constants/ambitiouskitchenConstants.js index a90d8e4..eba2f9f 100644 --- a/test/constants/ambitiouskitchenConstants.js +++ b/test/constants/ambitiouskitchenConstants.js @@ -51,6 +51,8 @@ module.exports = { ready: "", total: "45 minutes" }, - servings: "6" + servings: "6", + image: + "https://www.ambitiouskitchen.com/wp-content/uploads/2018/07/Street-Corn-Pasta-Salad-4.jpg" } }; diff --git a/test/constants/bbcConstants.js b/test/constants/bbcConstants.js index 3415346..736daf9 100644 --- a/test/constants/bbcConstants.js +++ b/test/constants/bbcConstants.js @@ -27,6 +27,8 @@ module.exports = { ready: "", total: "" }, - servings: "Serves 2" + servings: "Serves 2", + image: + "https://ichef.bbci.co.uk/food/ic/food_16x9_448/recipes/sausage_and_gnocchi_bake_80924_16x9.jpg" } }; diff --git a/test/constants/bbcgoodfoodConstants.js b/test/constants/bbcgoodfoodConstants.js index 695236d..0f502c5 100644 --- a/test/constants/bbcgoodfoodConstants.js +++ b/test/constants/bbcgoodfoodConstants.js @@ -28,6 +28,8 @@ module.exports = { ready: "", total: "" }, - servings: "Makes 12" + servings: "Makes 12", + image: + "https://www.bbcgoodfood.com/sites/default/files/recipe_images/recipe-image-legacy-id--856543_10.jpg" } }; diff --git a/test/constants/bonappetitConstants.js b/test/constants/bonappetitConstants.js index b923b0d..fd24cca 100644 --- a/test/constants/bonappetitConstants.js +++ b/test/constants/bonappetitConstants.js @@ -33,6 +33,8 @@ module.exports = { ready: "", total: "" }, - servings: "4 servings" + servings: "4 servings", + image: + "https://assets.bonappetit.com/photos/5d4b5b3cecc81500091c6835/16:9/w_1200,c_limit/0919-Soba-Noodles.jpg" } }; diff --git a/test/constants/budgetbytesConstants.js b/test/constants/budgetbytesConstants.js index 0c41f18..e3d99c2 100644 --- a/test/constants/budgetbytesConstants.js +++ b/test/constants/budgetbytesConstants.js @@ -34,6 +34,8 @@ module.exports = { ready: "", total: "1 hr 10 mins" }, - servings: "6" + servings: "6", + image: + "https://www.budgetbytes.com/wp-content/uploads/2012/10/Chicken-and-Lime-Soup-above.jpg" } }; diff --git a/test/constants/closetcookingConstants.js b/test/constants/closetcookingConstants.js index acbcf5e..e535e03 100644 --- a/test/constants/closetcookingConstants.js +++ b/test/constants/closetcookingConstants.js @@ -43,6 +43,8 @@ module.exports = { ready: "", total: "45 minutes" }, - servings: "4" + servings: "4", + image: + "https://www.closetcooking.com/wp-content/uploads/2019/08/Reina-Pepiada-Arepa-Chicken-and-Avocado-Sandwich-1200-4572.jpg" } }; diff --git a/test/constants/cookieandkateConstants.js b/test/constants/cookieandkateConstants.js index 900ec3f..caa9a60 100644 --- a/test/constants/cookieandkateConstants.js +++ b/test/constants/cookieandkateConstants.js @@ -45,6 +45,8 @@ module.exports = { ready: "", total: "45 minutes" }, - servings: "8 spring rolls" + servings: "8 spring rolls", + image: + "https://cookieandkate.com/images/2019/08/fresh-spring-rolls-recipe-4.jpg" } }; diff --git a/test/constants/copykatConstants.js b/test/constants/copykatConstants.js index b017eb8..924e7e8 100644 --- a/test/constants/copykatConstants.js +++ b/test/constants/copykatConstants.js @@ -24,6 +24,8 @@ module.exports = { ready: "", total: "12 minutes" }, - servings: "4" + servings: "4", + image: + "https://copykat.com/wp-content/uploads/2019/07/butter-air-fryer-croutons.jpg" } }; diff --git a/test/constants/damndeliciousConstants.js b/test/constants/damndeliciousConstants.js index 6c6793d..3a36e1d 100644 --- a/test/constants/damndeliciousConstants.js +++ b/test/constants/damndeliciousConstants.js @@ -32,6 +32,8 @@ module.exports = { ready: "", total: "3 hours 15 minutes" }, - servings: "8 servings" + servings: "8 servings", + image: + "https://s23209.pcdn.co/wp-content/uploads/2019/08/Raspberry-Croissant-French-Toast-BakeIMG_0314-760x1140.jpg" } }; diff --git a/test/constants/eatingwellConstants.js b/test/constants/eatingwellConstants.js index 02f4186..e11407d 100644 --- a/test/constants/eatingwellConstants.js +++ b/test/constants/eatingwellConstants.js @@ -37,7 +37,9 @@ module.exports = { ready: "", total: "45 mins" }, - servings: "6" + servings: "6", + image: + "https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fimages.media-allrecipes.com%2Fuserphotos%2F5397860.jpg" }, expectedRecipe2: { name: "Mexican Pasta Salad with Creamy Avocado Dressing", @@ -70,6 +72,8 @@ module.exports = { ready: "", total: "20 mins" }, - servings: "6" + servings: "6", + image: + "https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fimages.media-allrecipes.com%2Fuserphotos%2F3759382.jpg" } }; diff --git a/test/constants/epicuriousConstants.js b/test/constants/epicuriousConstants.js index d248d2f..fa9c31d 100644 --- a/test/constants/epicuriousConstants.js +++ b/test/constants/epicuriousConstants.js @@ -35,6 +35,8 @@ module.exports = { ready: "", total: "" }, - servings: "4 servings" + servings: "4 servings", + image: + "https://assets.epicurious.com/photos/5c1146171ba70e4fce83c3e5/2:1/w_1260%2Ch_630/trout-toast-with-soft-scrambled-eggs-recipe-BA-121218.jpg" } }; diff --git a/test/constants/finecookingConstants.js b/test/constants/finecookingConstants.js index f9bdcf3..d83a245 100644 --- a/test/constants/finecookingConstants.js +++ b/test/constants/finecookingConstants.js @@ -34,6 +34,8 @@ module.exports = { ready: "", total: "" }, - servings: "6" + servings: "6", + image: + "https://s3.amazonaws.com/finecooking.s3.tauntonclud.com/app/uploads/2019/08/20135635/white-chicken-chili_wide.jpg" } }; diff --git a/test/constants/foodConstants.js b/test/constants/foodConstants.js index d552981..7d90b04 100644 --- a/test/constants/foodConstants.js +++ b/test/constants/foodConstants.js @@ -41,6 +41,8 @@ module.exports = { ready: "", total: "26mins" }, - servings: "" + servings: "", + image: + "https://img.sndimg.com/food/image/upload/w_555,h_416,c_fit,fl_progressive,q_95/v1/img/recipes/35/81/3/KU3JVxMDRriISEG3KdPy_0S9A9740.jpg" } }; diff --git a/test/constants/foodandwineConstants.js b/test/constants/foodandwineConstants.js index bb09f06..39d65fa 100644 --- a/test/constants/foodandwineConstants.js +++ b/test/constants/foodandwineConstants.js @@ -34,6 +34,7 @@ module.exports = { ready: "", total: "2 HR 10 MIN" }, - servings: "4" + servings: "4", + image: "https://www.foodandwine.com/img/misc/og-default.png" } }; diff --git a/test/constants/foodnetworkConstants.js b/test/constants/foodnetworkConstants.js index 9ad938f..96653a6 100644 --- a/test/constants/foodnetworkConstants.js +++ b/test/constants/foodnetworkConstants.js @@ -35,7 +35,9 @@ module.exports = { ready: "", total: "45 min" }, - servings: "" + servings: "", + image: + "https://food.fnr.sndimg.com/content/dam/images/food/fullset/2016/12/4/2/FNK_Cast-Iron-Skillet-Provencal-Pork-Chops-and-Potatoes-1_s4x3.jpg.rend.hgtvcom.616.462.suffix/1480899712026.jpeg" }, anotherExpectedRecipe: { name: "Knead Not Sourdough", @@ -60,6 +62,8 @@ module.exports = { ready: "", total: "20 hr 55 min" }, - servings: "" + servings: "", + image: + "https://food.fnr.sndimg.com/content/dam/images/food/fullset/2008/5/27/0/EA1120_Knead-Not-Sourdough.jpg.rend.hgtvcom.616.462.suffix/1371587310017.jpeg" } }; diff --git a/test/constants/gimmesomeovenConstants.js b/test/constants/gimmesomeovenConstants.js index aad9c21..64bfdd6 100644 --- a/test/constants/gimmesomeovenConstants.js +++ b/test/constants/gimmesomeovenConstants.js @@ -32,6 +32,8 @@ module.exports = { ready: "", total: "35 minutes" }, - servings: "4 -6 servings" + servings: "4 -6 servings", + image: + "https://www.gimmesomeoven.com/wp-content/uploads/2019/05/The-Juiciest-Chicken-Kabobs-Recipe-1-2-768x1152.jpg" } }; diff --git a/test/constants/kitchenstoriesConstants.js b/test/constants/kitchenstoriesConstants.js index 0e90314..33ad8b7 100644 --- a/test/constants/kitchenstoriesConstants.js +++ b/test/constants/kitchenstoriesConstants.js @@ -37,6 +37,8 @@ module.exports = { ready: "", total: "" }, - servings: "4" + servings: "4", + image: + "https://images.kitchenstories.io/wagtailOriginalImages/R1879-photo-final-04.jpg" } }; diff --git a/test/constants/myrecipesConstants.js b/test/constants/myrecipesConstants.js index 2de2856..1612ca4 100644 --- a/test/constants/myrecipesConstants.js +++ b/test/constants/myrecipesConstants.js @@ -45,6 +45,8 @@ module.exports = { total: "2 Hours 30 Mins" }, servings: - "Serves 4 (serving size: about 4 oz. steak, 3/4 cup potatoes, 1/2 cup broccoli, and 2 Tbsp. aioli)" + "Serves 4 (serving size: about 4 oz. steak, 3/4 cup potatoes, 1/2 cup broccoli, and 2 Tbsp. aioli)", + image: + "https://imagesvc.meredithcorp.io/v3/mm/image?url=https%3A%2F%2Fcdn-image.myrecipes.com%2Fsites%2Fdefault%2Ffiles%2Fstyles%2F4_3_horizontal_-_1200x900%2Fpublic%2Flondonbroil.jpg%3Fitok%3Dea0rwT73" } }; diff --git a/test/constants/seriouseatsConstants.js b/test/constants/seriouseatsConstants.js index 885ad6e..a0e9cba 100644 --- a/test/constants/seriouseatsConstants.js +++ b/test/constants/seriouseatsConstants.js @@ -31,6 +31,8 @@ module.exports = { ready: "", total: "20 minutes" }, - servings: "Serves 4" + servings: "Serves 4", + image: + "https://www.seriouseats.com/2019/08/20190731-Oi-naengguk-chilled-cucumber-soup-vicky-wasik-5-1500x1125.jpg" } }; diff --git a/test/constants/simplyrecipesConstants.js b/test/constants/simplyrecipesConstants.js index e5ca7ce..242dc72 100644 --- a/test/constants/simplyrecipesConstants.js +++ b/test/constants/simplyrecipesConstants.js @@ -36,6 +36,8 @@ module.exports = { ready: "", total: "" }, - servings: "4 servings" + servings: "4 servings", + image: + "https://www.simplyrecipes.com/wp-content/uploads/2019/08/summer-chicken-panzanella-Lead5.jpg" } }; diff --git a/test/constants/smittenkitchenConstants.js b/test/constants/smittenkitchenConstants.js index 2b9527c..e4d7e0c 100644 --- a/test/constants/smittenkitchenConstants.js +++ b/test/constants/smittenkitchenConstants.js @@ -34,7 +34,9 @@ module.exports = { ready: "", total: "" }, - servings: "4 as an appetizer or 2 as a light meal" + servings: "4 as an appetizer or 2 as a light meal", + image: + "https://smittenkitchendotcom.files.wordpress.com/2014/12/endives-with-oranges-and-almonds1.jpg" }, expectedRecipeNewV1: { name: "Blackberry-Blueberry Crumb Pie", @@ -83,7 +85,9 @@ module.exports = { ready: "", total: "1 1/2 to 2 hours (with pie dough)" }, - servings: "8" + servings: "8", + image: + "https://smittenkitchendotcom.files.wordpress.com/2017/08/blackberry-blueberry-crumb-pie.jpg?w=1200" }, expectedRecipeNewV2: { name: " Cheesecake Bars with All The Berries", @@ -121,6 +125,8 @@ module.exports = { ready: "", total: "1 hour, plus cooling time" }, - servings: "24" + servings: "24", + image: + "https://smittenkitchendotcom.files.wordpress.com/2017/08/cheesecake-bars-with-all-the-berries.jpg?w=1200" } }; diff --git a/test/constants/thepioneerwomanConstants.js b/test/constants/thepioneerwomanConstants.js index 4c398b9..c636edf 100644 --- a/test/constants/thepioneerwomanConstants.js +++ b/test/constants/thepioneerwomanConstants.js @@ -20,7 +20,7 @@ module.exports = { "2 Tablespoons Worcestershire Sauce", "1 Tablespoon Soy Sauce", "1 cup Water", - "10 whole Crusty Deli Rolls/sub Rolls, Toasted", + "10 whole Crusty Deli Rolls/sub Rolls, Toasted" ], instructions: [ "Preheat the oven to 475 degrees. Tie the piece of meat tightly with a couple of pieces of kitchen twine.", @@ -36,6 +36,8 @@ module.exports = { ready: "", total: "" }, - servings: "10 Servings" + servings: "10 Servings", + image: + "https://tastykitchen.com/recipes/wp-content/uploads/sites/2/2016/05/DSC_0580-420x280.jpg" } }; diff --git a/test/constants/therealdealfoodrdsConstants.js b/test/constants/therealdealfoodrdsConstants.js index 204e310..052be38 100644 --- a/test/constants/therealdealfoodrdsConstants.js +++ b/test/constants/therealdealfoodrdsConstants.js @@ -28,7 +28,7 @@ module.exports = { "In a large pot or Dutch oven over medium heat add the oil. Once the oil is hot, add ground meat, garlic, onions, bell peppers, zucchini or yellow squash, and carrots and sauté for 7-9 minutes or until meat is cooked and no longer pink.", "Add seasonings, tomato sauce, crushed tomatoes, beans, corn, and water. Bring to a boil over medium-high heat. Reduce heat to low, cover, and simmer for 15 minutes or until carrots are tender. Serve with toppings of choice.", "Slow Cooker Directions:", - "Follow directions for the Stovetop version through Step 1.", + "Follow directions for the Stovetop version through Step 1.", "Add turkey and vegetable mixture to slow cooker.", "Add remaining ingredients (except salt and pepper) and stir to combine.", "Cook on LOW for 8 hours or on HIGH for 4 hours." @@ -41,6 +41,8 @@ module.exports = { ready: "", total: "40 mins" }, - servings: "6" + servings: "6", + image: + "https://therealfoodrds.com/wp-content/uploads/2017/10/IMG_9397-2-e1508438046925.jpg" } }; diff --git a/test/constants/thespruceeatsConstants.js b/test/constants/thespruceeatsConstants.js index 98ab0ae..356f483 100644 --- a/test/constants/thespruceeatsConstants.js +++ b/test/constants/thespruceeatsConstants.js @@ -36,6 +36,8 @@ module.exports = { ready: "", total: "25 mins" }, - servings: "1 pound (4 servings)" + servings: "1 pound (4 servings)", + image: + "https://www.thespruceeats.com/thmb/hbRXYt8onovguH2qKiAAKu3zcUk=/2309x1299/filters:fill(auto,1)/GettyImages-635101877-5955ee1c5f9b5815d9ce05f2.jpg" } }; diff --git a/test/constants/whatsgabycookingConstants.js b/test/constants/whatsgabycookingConstants.js index 0f109b1..8430bff 100644 --- a/test/constants/whatsgabycookingConstants.js +++ b/test/constants/whatsgabycookingConstants.js @@ -1,45 +1,51 @@ module.exports = { - testUrl: "https://whatsgabycooking.com/cauliflower-rice-kale-bowls-instant-pot-black-beans/", + testUrl: + "https://whatsgabycooking.com/cauliflower-rice-kale-bowls-instant-pot-black-beans/", invalidUrl: "https://whatsgabycooking.com/notarealurl", invalidDomainUrl: "www.invalid.com", nonRecipeUrl: "https://whatsgabycooking.com/category/food-drink/menu-plans/", expectedRecipe: { - name: - 'Cauliflower Rice Veggie Bowls (with Instant Pot Black Beans)', - ingredients: - [ '1 red onion finely diced', - '6 cloves garlic roughly chopped', - '2 tablespoons olive oil', - '1 bay leaf', - '1 teaspoon dried oregano', - '1 teaspoon cumin', - '½ teaspoon paprika', - '3-4 chipotles in adobo', - '1 pound dry black beans', - '1 teaspoon kosher salt', - '6 cups water', - '3 large sweet potatoes diced', - '2 tablespoons olive oil', - 'kosher salt and freshly cracked black pepper', - '4 cups cauliflower florets', - '1 bunch dinosaur kale thinly sliced', - '1 tablespoon olive oil', - '1 recipe Homemade Guacamole' ], - instructions: - [ 'For the Black Beans', - 'Turn the instant pot to saute. Add the oil, red onion and garlic and saute for 3-4 minutes. Add the spices and peppers and stir to combine. Add the dry beans, salt, and water in the bowl of the Instant Pot and give it a stir. Cover with the lid, and be sure to turn the vent at the top to the "sealed" position. Set the Instant Pot to cook for 45 minutes on the Chili setting. When the timer goes off, let the steam pressure naturally release for at least 20 minutes before attempting to remove the lid. Drain the beans from most of their liquid and store them in an airtight container the fridge or freezer until ready to use.', - 'For the sweet potatoes', - 'While the beans are cooking, dice the sweet potatoes and transfer to a baking sheet. Drizzle with olive oil, salt and pepper and roast in a 425 degree oven for 25-30 minutes until golden brown. Remove and set aside.', - 'For the Cauliflower rice', - 'Make sure your cauliflower is fully dry. Place the cauliflower in a food processor and pulse until it has the texture of rice. Work in batches and don’t over process or it will get mushy. In a large skillet, heat 1 tablespoons of olive oil over medium heat. Add the kale and sauté until wilted. Add the cauliflower and saute, until heated through, about 5 minutes. Season with salt, pepper and a squeeze of lemon juice to help remove any bitterness from the raw cauliflower.', - 'Assembly', - 'Portion the Cauliflower rice into 4 serving bowls. Add a spoonful of the beans to each bowl and a spoonful of the roasted sweet potatoes. Top with plenty of guacamole and serve.' ], - time: - { prep: '5 minutes', - cook: '45 minutes', - active: '', - inactive: '', - ready: '', - total: '50 minutes' }, - servings: '6' } + name: "Cauliflower Rice Veggie Bowls (with Instant Pot Black Beans)", + ingredients: [ + "1 red onion finely diced", + "6 cloves garlic roughly chopped", + "2 tablespoons olive oil", + "1 bay leaf", + "1 teaspoon dried oregano", + "1 teaspoon cumin", + "½ teaspoon paprika", + "3-4 chipotles in adobo", + "1 pound dry black beans", + "1 teaspoon kosher salt", + "6 cups water", + "3 large sweet potatoes diced", + "2 tablespoons olive oil", + "kosher salt and freshly cracked black pepper", + "4 cups cauliflower florets", + "1 bunch dinosaur kale thinly sliced", + "1 tablespoon olive oil", + "1 recipe Homemade Guacamole" + ], + instructions: [ + "For the Black Beans", + 'Turn the instant pot to saute. Add the oil, red onion and garlic and saute for 3-4 minutes. Add the spices and peppers and stir to combine. Add the dry beans, salt, and water in the bowl of the Instant Pot and give it a stir. Cover with the lid, and be sure to turn the vent at the top to the "sealed" position. Set the Instant Pot to cook for 45 minutes on the Chili setting. When the timer goes off, let the steam pressure naturally release for at least 20 minutes before attempting to remove the lid. Drain the beans from most of their liquid and store them in an airtight container the fridge or freezer until ready to use.', + "For the sweet potatoes", + "While the beans are cooking, dice the sweet potatoes and transfer to a baking sheet. Drizzle with olive oil, salt and pepper and roast in a 425 degree oven for 25-30 minutes until golden brown. Remove and set aside.", + "For the Cauliflower rice", + "Make sure your cauliflower is fully dry. Place the cauliflower in a food processor and pulse until it has the texture of rice. Work in batches and don’t over process or it will get mushy. In a large skillet, heat 1 tablespoons of olive oil over medium heat. Add the kale and sauté until wilted. Add the cauliflower and saute, until heated through, about 5 minutes. Season with salt, pepper and a squeeze of lemon juice to help remove any bitterness from the raw cauliflower.", + "Assembly", + "Portion the Cauliflower rice into 4 serving bowls. Add a spoonful of the beans to each bowl and a spoonful of the roasted sweet potatoes. Top with plenty of guacamole and serve." + ], + time: { + prep: "5 minutes", + cook: "45 minutes", + active: "", + inactive: "", + ready: "", + total: "50 minutes" + }, + servings: "6", + image: + "https://cdn.whatsgabycooking.com/wp-content/uploads/2018/02/WGC-Instant-Pot-Bowl-copy-2.jpg" + } }; diff --git a/test/constants/yummlyConstants.js b/test/constants/yummlyConstants.js index b2cd1e0..b9cbe13 100644 --- a/test/constants/yummlyConstants.js +++ b/test/constants/yummlyConstants.js @@ -38,6 +38,8 @@ module.exports = { ready: "", total: "35 Minutes" }, - servings: "4" + servings: "4", + image: + "https://www.yummly.com/images/No-Bake-Lemon-Mango-Cheesecakes-with-Speculoos-crust-recipe-781945" } };