recipe-nutrition-analyzer
Ruby CLI tool to get nutritional information for a recipe from EDAMAM's nutrition analysis API
TOC
- Sign up for developer account at EDAMAM
- In the developer portal, go navigate to Dashboard > Applications.
- Create a new application using the Nutritional Analysis API.
- Copy the Application ID and Application Keys.
- Clone or copy this repo into your development environment.
- In
config/
directory, create a.env
file and add the following lines (replace x's with copied values):- API_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxx"
- APP_ID="xxxxxxxx"
- Open up your terminal and type
bundle install
.
- After installing, in the terminal, type
bin/recipeAnalyzer
- If you get an error saying something about not being able to execute the file, enter
chmod +x bin/recipeAnalyzer
. ⚠️ ⚠️ know what you are doing and what this does first!⚠️ ⚠️
- If you get an error saying something about not being able to execute the file, enter
- The CLI application will welcome you and ask for a title. Enter a meaningful but short name.
- The CLI will prompt for a number of servings. Enter a whole number greater than 0.
- After asking for a title and number of servings, the CLI will prompt you for ingredients one at a time. The desired format is also printed out for reference.
- Typing "example" will make the CLI display a couple of sample ingredients.
- Typing "help" will display abbreviations for common weights and measures used in cooking.
- Typing "finished" will finalize the recipe and send the information to EDAMAM.
- When successful, the CLI will display the nutrition info of the entire recipe similar to an FDA food label. All numbers are given per serving.
Bottom line: I will be a kind human. Please be the same in return.
This is an early work in progress so I will be actively making changes. As such, please submit a contribution idea through opening an issue before working on a pull request. Don't submit a pull request at this unless it has been discussed through an issue ticket. I happily respond to all contructive inquiries.
As this project evolves, I will update this readme and how contributions are accepted.
- allow for recipe editing prior to competion
- confirm recipe ingredients before sending
- on completion, prompt to create new or exit
- on band responses, prompt to create new or exit
- allow user to see previous nutritional results
- scrape r-recipe microformatted pages for recipe list
- persist results to database