Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

command line access to ausnom.com

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bin
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 HISTORY
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 nom.gemspec
README.rdoc

nom

Command line access to ausnom.com, a webservice exposing AU and NZ nutritional data as provided by foodstandards.gov.au.

Usage

~ $ nom Tofu
1: Ice Confection, Tofu-Based, Vanilla Flavour
2: Tofu (Soy Bean Curd), Burger Pattie, As Purchased
3: Tofu (Soy Bean Curd), Firm, As Purchased
4: Tofu (Soy Bean Curd), Silken Or Soft, As Purchased
5: Tofu (Soy Bean Curd), Smoked, As Purchased
~ $ nom Tofu 5
Tofu (Soy Bean Curd), Smoked, As Purchased
Energy     751.0KJ
Protein    17.3G
~ $ nom Tofu 3
Tofu (Soy Bean Curd), Firm, As Purchased
Energy     530.0KJ
Protein    12.0G

You can customize the nutrients shown by creating ~/.nom to look like this:

base: ausnom.com
nutrients:
  - Energy
  - Protein

Install

gem install nom

Compatibility

Tested on 1.8.7 and 1.9.2.

Developing

git clone git://github.com/xaviershay/nom.git
bundle install
rake # Run the specs

The specs include integration tests that run against the live website, so you will need internet access for them to pass. Alternatively, you can set up an ausnom server on your machine and develop against that (github.com/xaviershay/ausnom).

Command line parsing is currently ad-hoc, I would be open to using a proper library to do this (optparse?)

Status

Spec'd, I use it, need to clean up the below TODOs before 1.0 release.

TODO

  • Display help text when no arguments provided

  • Allow calories to be displayed rather than energy

Something went wrong with that request. Please try again.