ソースを参照

Reorganize folder structure: cleanup names and remove unused files

Tati 7 年 前
コミット
baee24c29d

ktchn/src/recipes/index.ts → ktchn/src/recipes/model.ts


+ 1 - 1
ktchn/src/recipes/scrape/index.ts

@@ -2,7 +2,7 @@ import RequestPromise from "request-promise";
 import Cheerio from "cheerio";
 import Sources from './sources';
 import { ScrapingSource } from './sources/index';
-import { Ingredient } from '../index';
+import { Ingredient } from '../model';
 import { parse as parseIngredient } from 'recipe-ingredient-parser';
 
 function selectSource(url: string): ScrapingSource|void {

+ 0 - 0
ktchn/src/recipes/scrape/service.ts


+ 1 - 1
ktchn/src/recipes/scrape/sources/all-recipes.ts

@@ -1,4 +1,4 @@
-import { Recipe, Author, RecipeDetails, ComposedIngredients } from '../../index';
+import { Recipe, Author, RecipeDetails, ComposedIngredients } from '../../model';
 import { parseIngredients } from '../index';
 
 const SELECTORS = {

+ 2 - 2
ktchn/src/recipes/scrape/sources/home-cooking-adventure.ts

@@ -1,5 +1,5 @@
-import { Recipe } from "../..";
-import { RecipeDetails, ComposedIngredients } from '../../index';
+import { Recipe } from "../../model";
+import { RecipeDetails, ComposedIngredients } from '../../model';
 import { parseIngredients } from '../index';
 
 const SELECTORS = {

+ 1 - 1
ktchn/src/recipes/scrape/sources/index.ts

@@ -3,7 +3,7 @@ import JOB from './joy-of-baking';
 import AR from './all-recipes';
 import HCA from './home-cooking-adventure';
 import JOC from './just-one-cookbook';
-import { Recipe } from '../../index';
+import { Recipe } from '../../model';
 
 
 export interface ScrapingSource {

+ 1 - 1
ktchn/src/recipes/scrape/sources/joy-of-baking.ts

@@ -1,4 +1,4 @@
-import { Recipe, Author, RecipeDetails, ComposedIngredients } from '../../index';
+import { Recipe, Author, RecipeDetails, ComposedIngredients } from '../../model';
 import { parseIngredients } from '../index';
 
 const JOB_AUTHOR_DATA: Author = {

+ 2 - 2
ktchn/src/recipes/scrape/sources/just-one-cookbook.ts

@@ -1,5 +1,5 @@
-import { Recipe, Ingredient } from "../..";
-import { RecipeDetails, ComposedIngredients } from '../../index';
+import { Recipe, Ingredient } from "../../model";
+import { RecipeDetails, ComposedIngredients } from '../../model';
 import { parseIngredients } from '../index';
 import R from 'ramda';
 

+ 1 - 1
ktchn/src/recipes/scrape/sources/laura-in-the-kitchen.ts

@@ -1,4 +1,4 @@
-import { Recipe, RecipeDetails, Ingredient, ComposedIngredients, Author } from '../../index';
+import { Recipe, RecipeDetails, Ingredient, ComposedIngredients, Author } from '../../model';
 import { parse as parseIngredient } from "recipe-ingredient-parser";
 
 const LITK_AUTHOR_DATA: Author = {

+ 0 - 15
ktchn/src/routes/scrape.js

@@ -1,15 +0,0 @@
-const requestPromise = require('request-promise');
-const cheerio = require('cheerio');
-
-const options = {
-  uri: 'https://joyofbaking.com/AppleTart.html',
-  transform: body => cheerio.load(body),
-};
-
-requestPromise(options).then(($) => {
-  //console.log('$', $('.Heading').text());
-})
-  .catch((err) => {
-    console.log(err);
-  })
-;