Skip to content

Commit

Permalink
Merge pull request #18 from kjones1876/master
Browse files Browse the repository at this point in the history
Added emotions endpoint
  • Loading branch information
Jason Morgan committed Mar 3, 2016
2 parents a055e90 + c4fa7da commit 4dd6500
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,15 @@ AlchemyAPI.prototype.taxonomies = function(data, options, cb) {
this._doRequest(this._getQuery(data, options, "GetRankedTaxonomy"), cb);
};

/**
* Function to return emotions of the data passed in
* @param {String} data The text to be passed to Alchemy can either a url, html text or plain text
* @return {Object}
*/
AlchemyAPI.prototype.emotions = function(data, options, cb) {
this._doRequest(this._getQuery(data, options, "GetEmotion"), cb);
};

/**
* Function to return category of the data passed in
* @param {String} data The text to be passed to Alchemy can either a url, html text or plain text
Expand Down
9 changes: 9 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ module.exports = {
test.done();
});
},
'get emotions': function(test) {
var alchemy = new Alchemy(apikey);
alchemy.emotions(testURL, {}, function(error, result) {
//console.log(result);
test.ifError(error);
//test.deepEqual(result.status, "OK");
test.done();
});
},
'get entities': function(test) {
var alchemy = new Alchemy(apikey);
alchemy.entities(testURL, {}, function(error, result) {
Expand Down

0 comments on commit 4dd6500

Please sign in to comment.