GithubHelp home page GithubHelp logo

dougy147 / marmiteur Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 16 KB

Dart mini-library to extract cooking recipe details given a URL.

License: BSD 3-Clause "New" or "Revised" License

Dart 100.00%

marmiteur's Introduction

Extract recipe details given a URL.

Getting started

import 'package:marmiteur/marmiteur.dart';

void main() async {
  String recipeURL = "https://www.marmiton.org/recettes/recette_burger-d-avocat_345742.aspx";
  var recipe = await marmiteur(recipeURL);
  print(recipe['name']);
  print(recipe['recipeIngredient']);
  print(recipe['recipeInstructions']);
  print(recipe['image']);
}

Also look at pub.dev/packages/marmiteur package installation instructions.

Usage

var recipe = await marmiteur(recipeURL); // recipeURL is a String
var recipe = await marmiteur(recipeURL, autoFormat = false); // unformated output

The main function marmiteur() returns a HashMap of all scrapped informations about the recipe. The keys it can be called with are listed in the following table. (Almost all self-explanatory.)

Be aware that the default type refers to the one outputed when using autoFormat=true in the main marmiteur() function (by default).

Key Default type Value description
name String Name of the recipe
recipeCategory List Recipe category (cocktail, chili...)
recipeCuisine List Cuisine type (starter, main course, dessert...)
image List Link to a photograph of the meal (if any)
video List Link to an instruction video (if any)
prepTime String -
cookTime String -
totalTime String prepTime + cookTime
recipeYield List Portion (Number of persons to eat)
recipeIngredient List -
recipeInstructions List -
author String -
description String -
keywords List -
datePublished String Publication date

Additional information

Version 3.0.0 works for a limited number of websites but should be enough for the painful work. Feel free to contribute to this package to expand it.

marmiteur's People

Contributors

dougy147 avatar

Stargazers

Matt avatar JdM avatar  avatar

Watchers

 avatar  avatar

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.