Skip to content
Brand comparison chart using Watson Tone Analyser
JavaScript HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A web app for comparing the social media (Twitter) perception of two brands. This is built using IBM Watson Tone Analyzer and PubNub BLOCKS.

Hosting Instructions

Clone this repository and configure the Watson Tone Analyzer and Twitter API to access those third party services. You will need to update the credentials of these services in the code.

The web server can be hosted on any bare metal server that supports Node.js. The BLOCK program must be deployed on PubNub. Refer the BLOCK provisioning guide for details.

After configuring all services, make sure that the PubNub keys are updated in the code as per your PubNub app subscription.

Setup Watson Tone Analyzer API

Step 1 : Login to the Bluemix account with the valid credentials, and goto Catalog.
Step 2 : Select the Tone Analyzer service under the Watson Services. alt-tag Step 3 : Give the service name and select the standard plan, you can see more about pricing there in that page, and click on the "create" button. alt-tag Step 4 : Once you create the service, it will redirect you the homepage of the service. There click on the "Service Credentials" to get the username and password to access the toneanalyzer api. alt-tag

Step 5 : Goto the program and set the username and password that you got from "step4" in the following lines
username - line number 12
password - line number 13

You can check the following link to learn how to use the Toneanalyzer using curl/node/python/java.

Setup for Twitter API

Step 1 : Login to with your valid twitter credentials alt-tag Step 2 : Click on the "Create New App" button to create a new twitter application. alt-tag Step 3 : Give the Application name and description about the application and give the website (give the dummy one if you dont have one) and click on "create your Twitter application" alt-tag Step 4 : Once the app is created click on the "Keys and Access Tokens" and copy the
1)Consumer Key
2)Consumer Secret
alt-tag Step 5 : scroll down the page click on "create my access token" button. alt-tag Step 6 : Once access token is created copy the
3)Access Token
4)Access Token Secret

These Four keys will be used for you to access the Twitter api from your Node.js Web Server.

Add these 4 parameters in the code in these following lines,
1)Consumer Key - line number 15
2)Consumer Secret - line number 16
3)Access Token - line number 17
4)Access Token Secret - line number 18

Setup PubNub Keys

Update the PubNub keys on the Node.js werver code in the following lines

Line 26 : Your PubNub Publish Key

Line 27 : Your PubNub Subscribe Key

You can’t perform that action at this time.