Think 2021: New tools have the developer ecosystem and IBM building together Learn more

Archived | Stream and analyze Tweets to create a social media dashboard

Archived content

Archive date: 2019-07-02

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.


Organizations are increasingly interested in their social media profile, and can derive insights into how they are perceived through analysis and classification. This pattern subscribes to Twitter screen names or hashtags and analyzes the content with the Watson™ Tone Analyzer and Natural Language Understanding (NLU), as well as the Watson Assistant API to classify (intents) the tweets. The enriched metadata is then saved to a Cloudant database, where Map Reduce functions are used to provide a high-level insight into the data.


In this pattern, our server application subscribes to a Twitter feed that is configured by the user. Each tweet received is analyzed for emotional tone and sentiment. The intent of the tweet is determined by the Watson Assistant service. All data is stored in a Cloudant® database, with the opportunity to store historical data as well. The information is presented in a Web UI as a series of graphs and charts.

When you complete this pattern, you’ll learn how to:

  • Run an application that monitors a Twitter feed.
  • Send the tweets to Watson Tone Analyzer, Assistant, and Natural Language Understanding for processing and analysis.
  • Store the information in a Cloudant database.
  • Present the information in a Node.js web UI.



  1. Tweets are pushed out by Twitter.
  2. The Cognitive Social CRM app (server.js) processes the tweet.
  3. The Watson Tone Analyzer Service performs analysis of sentiment and emotional tone.
  4. The Watson Natural Language Understanding Service pulls out keywords and entities.
  5. The Watson Assistant Service extracts the intents (verbs) from the tweets.
  6. Tweets and metadata are stored in Cloudant.
  7. The Web UI displays charts and graphs as well as the tweets.


The setup is done in three primary steps. You will download the code, set up the application, and deploy the code to IBM Cloud. If you would like to run the code locally, there will be one more step to configure the credentials locally.

  1. Clone the repo.
  2. Install the dependencies.
  3. Take care of the Twitter requirements.
  4. Create Watson services with IBM Cloud.
  5. Import the Assistant workspace.
  6. Configure the credentials.
  7. Run the application.