/pcb

Chat bot understanding your emotion from your selfie

Primary LanguageJavaScript

PCB

You can read the story behind this project, if you prefer more narrative form of information :)

Setup

  1. You need to install node.js
  2. Clone the repo and npm install to get dependencies
  3. Create a config.json in your home directory with similar structure of config.dist.json (you can just copy this file to config.json and add your values, i.e. cp config.dist.json ~/config.json)
  4. Create an app (bot) and take its handle, id, etc. for the config file
  5. Add the following "Messaging endpoint" in the bot settings page https://dev.botframework.com/bots?id=YOUR_BOT_ID as https://YOUR_PUBLIC_IP_ADDRESS/api/messages
  6. Check out the "Useful links" section for further details

Emotion wrapper

emotion.js abstracts service calls to the Emotions API, works with promises in order to be then()-able. Example implementation included:

var getEmotion = require('../emotion')

var imageUrl = 'https://pcb-kalinchernev.c9users.io/example.jpg'

var options = {
  body: {
    url: imageUrl
  }
}

// Get a then-able reply from the expert
getEmotion(options).then(data => console.log(data));

Useful links

Misc

  • runners directory contains a custom runner with nodemon: faster development

FUN

Example usage of the emotion module: (pretty rough implementation)

alt text