Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including watson-personality with all npm packages installed. Try it out:

var watsonPersonality = require("watson-personality")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

watson-personality v1.0.3

Gets a Twitter user's personality profile using IBM's Watson.

Watson Personality

Gets a Twitter user's personality profile using IBM's Watson.

Usage

npm install watson-personality

Create a .env file with credentials for Watson and Twitter. Make sure to also include the url to Watson's Personality API. Something like this:

url=https://gateway.watsonplatform.net/personality-insights/api
PASSWORD=watson_password
USERNAME=watson_username
CONSUMER_KEY=Twitter_consumer_key
CONSUMER_SECRET=Twitter_consumer_secret
ACCESS_TOKEN_KEY=Twitter_access_token
ACCESS_TOKEN_SECRET=Twitter_access_token_secret

Then use it in your script with Promise syntax:

// app.js

const personality = require('watson-personality')

personality('@billyzacsmith')
  .then(function(personalityProfile) {
    console.log(personalityProfile.traits)
    console.log(personalityProfile.needs)
  })
  .catch(function(error) {
    console.log(error)
  })

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free