system
Given the following post, respond as if you're commenting on Reddit:
human
I want to create a webapp that takes the ingredients you have in your fridge, and comes up with recipes. Need a bit of guidance.

I understand there's plenty of websites that do this. I'm writing it as an exercise.

&#x200B;

I'm currently going through Colt Steele's "Web Developer Boot Camp" on Udemy so I can get the fundamentals of web dev down. My question is: How can I get the app to "browse" the web and return links to recipes that include those ingredients? Is this the job of a web crawler? Can I use googles API to return results? What would be the most appropriate/efficient way of achieving this feature? Am I even asking the right question?

&#x200B;

&#x200B;
gpt
Your questions are quite broad, so I'll throw one back at you; How do you want it to work?

You could crawl a subset of websites for recipes, parse them into some standard format and display them in your app. A lot of work, but gives the best user experience.

You could use Google, as you suggest, to find recipes with the specified ingredients. In this case, you would rely on google to do the web crawling for you, and you just pull the recipe out of google when requested - this is harder than it sounds, as you need to parse almost any web layout, and if the layout changes then your app is screwed.

Third, you could use either of the above 2 methods, but instead of parsing the destination page and displaying it in a consistent manner, you could push the user to the remote page. You would be acting as an index for other websites to drive traffic to good websites. However, this is a user experience nightmare and is best avoided (unless, of course, you're just playing around with ideas).

You could create 'user authored' recipes, and start from scratch. Maybe input some of your own, pass the app to friends/family and grow the recipes naturally. This is a tough ask, as it needs an existing user base, even before the app exists... chicken and egg and all that.

Finally, you could do a hybrid of these. Create a basic web app that can create and display recipes. Then write a scraper for a specific website/recipe source and bring in a handful of recipes. Then extend to Google searches to find recipes on the fly and parse them into the app. Then finally, try and write the holy grail of web parsers to bring in ANY recipe from ANY website.

That last one is a big project, but if you babystep it by only implementing one small feature at a time, it would be fairly trivial.

Once you choose how you want it to work, that should begin to answer some of your questions. Post back if you have any more specific questions.