A ruby wrapper for the FatSecret API. Currently only supports the foods.search and food.get methods, but I will add more when I have the need/time. Alternatively please feel free to send a tested pull request.
Get your api key and oauth tokens by signing up for an account with FatSecret at http://platform.fatsecret.com/api/Default.aspx?screen=r
Bundler:
gem 'fat_secret'
Otherwise:
gem install fat_secret
FatSecret.configure do |config|
config.access_key = <your access key>
config.consumer_key = <your consumer key>
config.shared_secret = <your shared secret>
config.logger = <your logger> #OPTIONAL
end
foods = FatSecret::Food.search('Milk')
food = FatSecret::Food.get(id)
food.servings #(automatically lazy loaded for you)
git clone git://github.com/mattbeedle/FatSecret.git
cd FatSecret
bundle install
Then add your own api keys to the spec/support/helpers.rb
file before running the specs with
bundle exec rspec