Live data from Hacker News

Show HN: An API for scraping recipe web pages

choppingboard.recipes

71–80 of 113 posts

Re: Show HN: An API for scraping recipe web pages

#71
post #41

Earlier quoted context omitted.

Those cards are genius. They perfectly illustrate what you can do parallel to other things rather than having to re-read and re-interpret the written instructions continuously.

I'm a fan of his recipe card as well, though I convert it to a standard recipe for sharing with friends who don't see the format in the same light. Also, a friend and I made enough of his Mac and Cheese[1] to serve 150 people at my wedding a couple years ago. Highly recommended. 1: http://www.cookingforengineers.com/recipe/230/Macaroni-and-C...

Looks great. I will give a recipe cards like this a try someday with actual cooking. Looking forward to experimenting with the format.

Re: Show HN: An API for scraping recipe web pages

#72
post #3

It looks good and seems to work with some arbitrarily picked recipes on the usual large recipe websites, although more obscure links cause some bugs¹. Is the source code on GitHub? Are you handling specific websites such as allrecipes.com with bespoke code? Technically the project is interesting, but if you want to offer a commercial API you might run into copyright and fair use issues (as with any scraping tool). No…

I'm actually amazed it manages to scrap minor websites. Scrappers usually have to take in consideration every single website they're targeted at, and they break each time there's a major redesign (or sometimes, a minor one). @brad0 : how did you manage that? Was thespruce.com in your targets?

I don't know about this scraper, but one thing that mine does (http://www.copymethat.com) is to "read" the complete page looking for certain word combinations that indicate ingredients or steps. It also considers styles and location on the page and looks for keywords that tend to start or end a recipe. It then picks what it considers to be the strongest recipe on the page. This means that it can pick up some weird things if the page doesn't actually contain a recipe; It really wants to find one!

Re: Show HN: An API for scraping recipe web pages

#73
I use Paprika for my recipes and IIRC their API for fetching back your recipes (not public) was actually pretty nice. I have played around with creating a meal prep blog for a while and I was going to write a little service that would hit their API so I could make embeddable widgets for the recipe that pulled directly from my account (so if I updated it in the app the web would update as well). Not the same thing as this at all but I'd be interested to see what JSON format they use for recipes.

Re: Show HN: An API for scraping recipe web pages

#74
post #72

Earlier quoted context omitted.

I'm actually amazed it manages to scrap minor websites. Scrappers usually have to take in consideration every single website they're targeted at, and they break each time there's a major redesign (or sometimes, a minor one). @brad0 : how did you manage that? Was thespruce.com in your targets?

I don't know about this scraper, but one thing that mine does ( http://www.copymethat.com ) is to "read" the complete page looking for certain word combinations that indicate ingredients or steps. It also considers styles and location on the page and looks for keywords that tend to start or end a recipe. It then picks what it considers to be the strongest recipe on the page. This means that it can pick up some weird…

Interesting approach, thanks for mentioning it. I guess it means you have a lot of unsuccessful results? Do you try iterate several times on the same page to find different possible sources for a given info and rank them, or is it something more like "if we're not confident enough, forget about that info"?

Re: Show HN: An API for scraping recipe web pages

#75
post #72

Earlier quoted context omitted.

I don't know about this scraper, but one thing that mine does ( http://www.copymethat.com ) is to "read" the complete page looking for certain word combinations that indicate ingredients or steps. It also considers styles and location on the page and looks for keywords that tend to start or end a recipe. It then picks what it considers to be the strongest recipe on the page. This means that it can pick up some weird…

Interesting approach, thanks for mentioning it. I guess it means you have a lot of unsuccessful results? Do you try iterate several times on the same page to find different possible sources for a given info and rank them, or is it something more like "if we're not confident enough, forget about that info"?

There are hardly any unsuccessful results. (Assuming that the page actually contains a recipe.) People have copied recipes from more than 70,000 websites into their recipe boxes. Of course, I can't check that all the millions of recipes have been accurately copied, but we do check a lot and also get terrific feedback. The parser first goes through all lines/sentences on the page and gives them a rank based on whether it seems to be an ingredient or step. Then it looks at groupings (several steps together) and then the placement of the ingredients compared to the steps.

Re: Show HN: An API for scraping recipe web pages

#76

This really seems to be an exercise in 'structuring recipe data' rather than the ins-and-outs of scraping. Seems like a much-needed task; is there anything approaching a 'standard' for recipe data already? "ingredients": [ "600g pineapple, peeled, chopped" ] This seems like a prime candidate for improvement; something like the following would seem to be more useful: "ingredients": [{ "ingredient": "pineapple", "quant…

This is only part of the problem. The second part is the instructions.

It's not clear to me what the best way to present the second part is.

Re: Show HN: An API for scraping recipe web pages

#77

This really seems to be an exercise in 'structuring recipe data' rather than the ins-and-outs of scraping. Seems like a much-needed task; is there anything approaching a 'standard' for recipe data already? "ingredients": [ "600g pineapple, peeled, chopped" ] This seems like a prime candidate for improvement; something like the following would seem to be more useful: "ingredients": [{ "ingredient": "pineapple", "quant…

Long forgotten Microformats is the way to go.

Re: Show HN: An API for scraping recipe web pages

#79
post #34

This falls under the category of unethical scraping

While it doesn't address your concerns about ethics, recipes are explicitly not covered by US copyright law (obviously there are other factors involved here, but that's certainly the big one).

There may be ethical questions here, but there shouldn't be any legal concerns (IANAL, just a guy in the process of building a site in this space).

Re: Show HN: An API for scraping recipe web pages

#80

This really seems to be an exercise in 'structuring recipe data' rather than the ins-and-outs of scraping. Seems like a much-needed task; is there anything approaching a 'standard' for recipe data already? "ingredients": [ "600g pineapple, peeled, chopped" ] This seems like a prime candidate for improvement; something like the following would seem to be more useful: "ingredients": [{ "ingredient": "pineapple", "quant…

I tried to build a little recipe DB along these lines years ago. What I ended up finding is that as I improved in my own food preparation skills, my interest in super-rigid recipes of this form diminished. Basically, there's just a lot of slush and room for experimentation in cooking. Think about making a stir fry— how many people would level off exact masses of different vegetables to combine in perfect proportion?…

Mark Bittman was the second biggest influencer of the way I prepare food. The first was a college roommate, who literally improvised everything he cooked, as far as ingredients and proportions go, and it tasted amazing every time. It opened my eyes to how subjective cooking can be.

I tried Blue Apron once. So boring.

Post reply on HN