node-red-web-nodes icon indicating copy to clipboard operation
node-red-web-nodes copied to clipboard

Fatsecret Calorie Counter Node

Open Raminios opened this issue 10 years ago • 0 comments
trafficstars

Query Node

Will pull calorie and food information that the user has input for a certain date from their Fatsecret account. This date can either be supplied in the node settings or as a the msg.time. There will also be a "yesterday" and "today" option.

Input Node

A polling system could be used to output a food whenever a new food is added to the user's diary. This feature is currently only proposed though.

Output Node

The API allows the user to add foods to their diary. A node could be implemented which would attach itself to a specific food and add it to the user's diary at time of input (similarly to the TFL cycle hire node pulling information to a set station).

A node like this would be useful for allowing the user to automatically add foods they regularly eat (add coffee every morning, add my favourite meal if a foursquare checkin at a restaurant etc.)

However, this would require accessing the API using credentials (an issue not present in the TFL API) and as this is the UI trying to access credentials, they often aren't yet in the runtime. This causes complications.

There are also exercise functions in the app and API, which could be used in conjunction with runkeeper or strava.

Options

  • credentials - the user will need to register for the api and follow the OAuth procedure to gain access to the API and use the node.

Query node

: There will be a drop down box in which the user can choose from: - `Today` - Will use the day's date to pull information. - `Yesterday` - Will use yesterday's date to pull the information. - `Date` - Will allow the user to specify a date from when to pull the information. - `Input` - Will use the date specified in the msg.input.

Outputs

The output will be an object containing 4 arrays:

  • breakfast - Will contain foods eaten that day for breakfast.
  • lunch - Will contain foods eaten that day for lunch.
  • dinner - Will contain foods eaten that day for dinner.
  • other - Will contain foods eaten that day outside of meals (snacks).

These arrays will contain several (or zero) objects with these properties:

  • food - Text name of the food.
  • calories - Number of calories of that food eaten.
  • serving - Size of serving of the food eaten.
  • amount - Amount of servings of the food eaten.

Raminios avatar Jan 08 '15 16:01 Raminios