Twitter Engagement

The Twitter Engagement API will be removed on April 15th, 2019.

twitterEngagement(data, {[apiKey]: String, [cloud]: String})

Arguments

data – String | List – required – text to be analyzed
[apiKey] – String – optional – your indico API key
[privateCloud] – String – optional – your private cloud subdomain

Output

This function will return a number between 0 and 1. This number is a probability representing the confidence that the analyzed text will be retweeted or favorited. Values greater than 0.5 indicate high engagement content, while values less than 0.5 indicate low engagement content.

# single output
0.640490385821421

# batch output
[
    0.640490385821421,
    0.44804264881126155
]

Example

var indico = require('indico.io');
indico.apiKey =  'YOUR_API_KEY';

var response = function(res) { console.log(res); }
var logError = function(err) { console.log(err); }

// single example
indico.twitterEngagement("Don't forget to vote tomorrow! #democracy #tom4classpresident")
  .then(response)
  .catch(logError);

// batch example
var batchInput = [
    "Don't forget to vote tomorrow! #democracy #tom4classpresident",
    "Severe weather warning. We advise you stay home. #weather #tornado #storm"
];
indico.twitterEngagement(batchInput)
  .then(response)
  .catch(logError);