FoodInfo

FoodInfo is a ruby gem that retrieves food nutrition information from various online data sources.

Installation

FoodInfo is available as a gem, so installation is as simple as:

geminstallfood_info

Supported Data Sources

There's currently only one adapter implemented, which pulls data from FatSecret's REST API. The code's modular and adding additional data sources should be fairly straightforward, but since DailyBurn discontinued their API access I don't know of any other solid sources (if you do, though, please let me know and/or add an adapter!).

Usage

Housekeeping

To use the FatSecret API (currently your only option), you'll first need to sign up for a free developer account and retrieve the "REST API Consumer Key" and "REST API Consumer Secret" from your "My Account" tab.

Once that's done, the first step is to tell FoodInfo which adapter you want to use and what authorization to send.

General metadata about the cheese includes id, name, kind, and url, which are identical to what you'd get from the search method. It also has one or more servings, however, and this is where we finally get our nutrition info.

Note on Patches/Pull Requests

As always, the process is to fork this project on Github, make your changes (preferably in a topic branch, and without changing the gem version), send a pull request, and then receive much appreciation!