openfood

Version, currently master branch1 version
  • master branchlatestFeb 4, 2017

github.com/denysvitali/crystal-openfood

Crystal openfood.ch library

0 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  openfood:
    github: denysvitali/crystal-openfood
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.20.5
License
MIT
Author
Denys Vitali

Dependencies

This version declares no dependencies.

README

openfood

Crystal module for openfood.ch

OpenFood is an independent and open database of barcoded edible products sold in Switzerland. It is maintained by the Digital Epidemiology Laboratory of EPFL and gratefully acknowledges access to the shops of Coop and Migros (Switzerland).

This module is still in development, contribute if you can :+1:

Installation

Add this to your application's shard.yml:

dependencies:
  openfood:
    github: denysvitali/openfood

Usage

require "openfood"

getProducts

result = OpenFood.getProducts(50) #Gets 50 products
# result is of type OpenFood::Pagination
result.data.each do |el|
  # el is of type OpenFood::Product (see src/openfood/responses/Product.cr)
  if el.attributes.name != nil
    puts el.attributes.name
  end
end

Contributing

  1. Fork it ( https://github.com/denysvitali/openfood/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors