0.2.4 • Published 12 years ago

yummly v0.2.4

Weekly downloads
4
License
-
Repository
github
Last release
12 years ago

Yummly API Module for Node.js

1.) Register an account at http://developer.yummly.com/.

var authentication = {
  id: '********',
  key: '********************************'
}

2.) Install Yummly module.

npm install yummly

3.) Require the search/recipe modules.

var
  search = require('yummly/search'),
  recipe = require('yummly/recipe');

4.) Call search/recipe function and have fun with Yummly's JSON object!

Search:

search({
  authentication: authentication,
  query: 'chicken'
}, function (error, response, json) {
  if (error) {
    console.error(error);
  } else if (response.statusCode === 200) {
    console.log(json);
  }
});

Recipe:

search({ // calling search first to get a recipe id
  authentication: authentication,
  query: 'pasta'
}, function (error, response, json) {
  if (error) {
    console.error(error);
  } else if (response.statusCode === 200) {
    recipe({
      authentication: authentication,
      id: json.matches[0].id // id of the first recipe returned by search
    }, function (error, response, json) {
      if (error) {
        console.error(error);
      } else {
        console.log(json);
      }
    });
  }
});
0.2.4

12 years ago

0.2.3

12 years ago

0.2.2

12 years ago

0.2.1

12 years ago

0.2.0

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.1

12 years ago