Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database update: make it so a new food gets added via FDC ID -> information pulled into database #40

Open
mrdbourke opened this issue Mar 22, 2022 · 2 comments

Comments

@mrdbourke
Copy link
Owner

mrdbourke commented Mar 22, 2022

I'd like to be able to add an FDC ID to some section or a single file and that file gets watched.

Every time a new FDC ID gets added to that file, information from the Food Data Central Database gets pulled in to be used Nutrify style.

For example:

  • New FDC ID added to a list
  • List gets watched and update found -> triggers function
  • Function goes to FDC database and pulls information based on the ID
  • Nutrition information from that food ID is placed in the Nutrify database to be displayed on the web
@shivan-s
Copy link

I understand you are using the API: https://fdc.nal.usda.gov/api-guide.html

I don't think they have a hook ability, so you might have to run a script that hits the database and looking or new foods once a day etc?

Maybe hitting the API and sorting by date and looking at recently publish foods: https://app.swaggerhub.com/apis/fdcnal/food-data_central_api/1.0.0#/FDC/getFoodsList

Good luck! I want to help but am working on my own project. When I have my project up and running will like to provide some commits. Keep up the work!

@mrdbourke
Copy link
Owner Author

You're right I haven't seen a hook ability yet.

Right now the ID's are manually sorted (e.g. I look through the database and see which ID best suits our food).

To begin, I'll have a file with the IDs and everytime a new ID gets added to that file, a script will run to ping the FDC database and then update the Nutrify database.

It'll be manual to begin with but more automation overtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants