Closed pjhampton closed 7 years ago
I would love to claim this issue. After setting up the development environment i am ready to get instant answers but this doesn't work with the Nutrition API. Are there any restriction issues in a local environment or am i missing some docs or something else? Or am i just working against "duckpan query"?
Eg: chicken Taco (works)
Eg: banana calories (throws error)
If you help me out i can give it a try. Thanks.
@fraed thanks for volunteering! We really appreciate it 😄
Unfortunately I'm unable to reproduce the failure you're seeing. Can you show me the output of the DuckPAN console? Can you also show me the network tab (specifically the JS content)
Also, have you modified any code yet?
I was able to recreate this on Codio 👍 Please see my comment below.
Could it be because the api keys @moollaza, @fraed?
@pjhampton @fraed I see the issues now. Because @fraed doesn't have an API key installed, we fallback to using the API endpoint on beta.duckduckgo.com. Currently, that API endpoint has been modified by another Pull Request, so the api_result
doesn't pass the first check in the Nutrition.js file.
@fraed are you able to signup for a free Nutritionix API key?
Once you have your own API Key you can add it to your shell environment (or via duckpan with duckpan add DDG_SPICE_NUTRITIONIX_APIKEY {val}
)
Then the API call will go straight the API instead of using the beta endpoint 👍
Thank you. My development environment works now 👍.
Hey @pjhampton, @moollaza, I figured out that this file https://github.com/fraed/zeroclickinfo-spice/blob/3209-nutrition-triggering/share/spice/nutrition/nutrition.js can't handle single word ia as it needs measurement infos. I solved it quick using a default value in line 38. Let me know if you have further instructions here or the using "calories" as a default value works for you. Thanks.
Let me know if you have further instructions here or the using "calories" as a default value works for you. Thanks.
@fraed I'm not too sure what you mean, but it sounds Ok. Please open a PR and we can discuss further there 👍
Problem
The Nutrition Instant Answer doesn't trigger for single-word food item searches, such as
avocado
,beef
, orsteak
:We should trigger on these queries and show an Instant Answer.
Solution
t/Nutrition.t
to confirm changes work as expectPeople to notify
@pjhampton
Get Started
Resources
Instant Answer Page: https://duck.co/ia/view/nutrition