Giter Club home page Giter Club logo

cookiput's Introduction

cookiput

Import chefkoch recipes to cookidoo via API call

Getting started

Install required dependencies:

pip install -r requirements.txt

Log in to cookidoo and get the auth token from the v-token cookie (F12 in most current browsers). This token needs to either be given as -jwt command line parameter or exported as an environment variable called COOKIDOO_JWT.

export COOKIDOO_JWT=eyXXXXXXX.....
python CookidooImporter.py https://www.chefkoch.de/......html

Usage

python CookidooImporter.py -h
usage: CookidooImporter.py [-h] [-jwt JWT] url

Cookidoo Importer

positional arguments:
  url         URL to import recipe from

options:
  -h, --help  show this help message and exit
  -jwt JWT    JSON Web Token for authenticated access to cookidoo

Developer access

Each class can be used on its own to just download recipe data or to import the recipe to cookidoo, so other recipe homepages should be easy to scrape with a custom importer.

API calls to create a recipe

First do a POST to the created-recipes endpoint:

POST /created-recipes/de-DE HTTP/2

{"recipeName":"My Awesome New Recipe"}

This will return the recipeId of the newly created recipe. You can then update the content of the recipe via PATCH requests to the created-recipes/de-DE/${recipeId} enpoint.

Adding ingredients

To add ingredients use a PATCH request to created-recipes/de-DE/${recipeId}:

{
  "ingredients": [
    { "type": "INGREDIENT", "text": "My ingredient 1" },
    { "type": "INGREDIENT", "text": "Another delicious ingredient" },
    { "type": "INGREDIENT", "text": "Neccessary other stuff" }
  ]
}

Adding steps

Adding steps for cooking is analogous to adding ingredients, use a PATCH request to created-recipes/de-DE/${recipeId}:

{
  "instructions": [
    { "type": "STEP", "text": "Prepare to stew" },
    { "type": "STEP", "text": "Add stuff" },
    { "type": "STEP", "text": "Bakeoff." }
  ]
}

Adding tools, time etc.

To add supported tools and needed time ranges use a PATCH request to created-recipes/de-DE/${recipeId}:

{
  "tools": ["TM6"],
  "totalTime": 4200,
  "prepTime": 3900,
  "yield": { "value": 4, "unitText": "portion" }
}

The times are in seconds, i.e. 3900s is one hour (3600s) and 5 minutes (300s).

cookiput's People

Contributors

croeer avatar

Stargazers

 avatar Jan Esser avatar

Watchers

 avatar  avatar

cookiput's Issues

Instruction Types

Moin,

thanks for your work!

I wonder if other instruction types or step parameters exist? It would be nice to also create the instructions for the machine like

  • set time to 5 seconds and blender speed to 8.5
  • switch to scale

Danke und Gruß,
Markus

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.