npm install alchemy-api-nav
var AlchemyAPI = require('./alchemyapi');
var alchemyapi = new AlchemyAPI();
var myText = "Whoa, AlchemyAPI's Node.js SDK is really great, I can't wait to build my app!";
alchemyapi.sentiment("text", myText, {}, function(response) {
console.log("Sentiment: " + response["docSentiment"]["type"]);
});
In Adonisjs
// bootstrap/app.js
'alchemy-api-nav/providers/AlchemyapiProvider'
// PageController.js
const alchemyapi = use('Alchemyapi')
class PageController {
* index (req, res) {
var myText = "I am feeling good about your broken record";
alchemyapi.sentiment("text", myText, {}, function(response) {
console.log("Sentiment: " + response["docSentiment"]["type"]);
});
return res.send('ok')
}
}