|
@@ -1,6 +1,6 @@
|
|
|
import RequestPromise from "request-promise";
|
|
import RequestPromise from "request-promise";
|
|
|
import Cheerio from "cheerio";
|
|
import Cheerio from "cheerio";
|
|
|
-import { Recipe, RecipeDetails, Ingredient, ComposedIngredients } from './index';
|
|
|
|
|
|
|
+import { Recipe, RecipeDetails, Ingredient, ComposedIngredients, Author } from './index';
|
|
|
import { parse } from "recipe-ingredient-parser";
|
|
import { parse } from "recipe-ingredient-parser";
|
|
|
|
|
|
|
|
type RegexMutator = (s: RegExpMatchArray) => number;
|
|
type RegexMutator = (s: RegExpMatchArray) => number;
|
|
@@ -19,6 +19,11 @@ const parseTime = (data: string) => {
|
|
|
return parsedHoursAsMin + parsedMinutes;
|
|
return parsedHoursAsMin + parsedMinutes;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const LAURA_DATA: Author = {
|
|
|
|
|
+ name: 'Laura in the Kitchen',
|
|
|
|
|
+ website: 'http://www.laurainthekitchen.com',
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const LAURA_MAP: {
|
|
const LAURA_MAP: {
|
|
|
[index:string] : {
|
|
[index:string] : {
|
|
|
key: string,
|
|
key: string,
|
|
@@ -98,6 +103,7 @@ function getInstructions($:CheerioSelector): string[] {
|
|
|
function lauraInTheKitchen($:CheerioSelector):Recipe {
|
|
function lauraInTheKitchen($:CheerioSelector):Recipe {
|
|
|
let recipe = new Recipe(
|
|
let recipe = new Recipe(
|
|
|
getRecipeName($),
|
|
getRecipeName($),
|
|
|
|
|
+ LAURA_DATA,
|
|
|
getRecipeDetails($),
|
|
getRecipeDetails($),
|
|
|
getIngredients($),
|
|
getIngredients($),
|
|
|
getInstructions($),
|
|
getInstructions($),
|