/marmiteur

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

Primary LanguageDartBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

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.