This is a Golang library for ingredient tagging and extraction for any recipe on the internet. This library compartmentalizes and improves aspects of recipe extraction that I did previously with schollz/meanrecipe and schollz/extract_recipe.
Try it online: https://schollz.com/blog/ingredients/#try
You can use it online, just do GET https://ingredients.schollz.now.sh/?url=X
where X
is a URL to a recipe website.
$ curl https://ingredients.schollz.now.sh/?url=https://cooking.nytimes.com/recipes/12320-apple-pie
You can use it from the command line! If you download a release, you can also use it from the command line:
$ ingredients https://www.tasteofhome.com/recipes/banana-chocolate-chip-cookies/
You can use as a library.
$ go get github.com/schollz/ingredients
Pick a random website, like JoyFoodSunshine, and you can extract the ingredients:
r, _ := ingredients.NewFromURL("https://joyfoodsunshine.com/the-most-amazing-chocolate-chip-cookies/")
fmt.Println(r.IngredientList())
// Output:
// 1 cup butter (salted)
// 1 cup sugar (white)
// 1 cup brown sugar (light)
// 2 tsp vanilla (pure)
// 2 whole eggs
// 3 cups flour (all purpose)
// 1 tsp baking soda
// 1/2 tsp baking powder
// 1 tsp salt (sea)
// 2 cups chocolate chips
Please make an issue if you find a problem.
See my blog post about it: schollz.com/blog/ingredients.
If you modify the corpus/
information then you will need to run
$ go generate
before using the library again.
Pull requests are welcome. Feel free to...
MIT