Skip to content

DevExCodeHub/gifty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

E-commerce Web app with Watson

Gifty

In this journey, our server application will get 200 tweets for a specified Twitter handle. These tweets will be analyzed by Waston Personality Insights to understand users’ habits and preferences on an individual level. Based on the resulting analysis, suggested gifts will be presented in a Web UI.

When the reader has completed this journey, they will understand how to:

  • Run an application that monitors a Twitter feed.
  • Send the tweets to Watson Personality Insights for processing and analysis.
  • Present the information in a Node.js web UI.

Flow

  1. User enters a Twitter handle name and click Find! button.
  2. Tweets are pushed out by Twitter.
  3. The app (app.js) processes the tweets.
  4. The Watson personality Insights Service performs analysis of consumption needs.
  5. The Web UI displays products that matches user consumption needs and preferences.

Included components

  • Waston Personality Insights: Predict personality characteristics, needs and values through written text. Understand your customers’ habits and preferences on an individual level, and at scale.
  • Cloud Foundry: Build, deploy, and run applications on an open source cloud platform.

Featured technologies

  • Artificial Intelligence: Artificial intelligence can be applied to disparate solution spaces to deliver disruptive technologies.
  • Node.js: An open-source JavaScript run-time environment for executing server-side JavaScript code.

Steps

The setup is done in 3 primary steps. You will download the code, setup the application and then deploy the code to IBM Cloud.

  1. Sign up on IBM Cloud
  2. Clone the repo
  3. Twitter Requirements
  4. Create Watson Personality Insights service with IBM Cloud
  5. Run the application

1. Sign up on IBM Cloud

If you do not already have an IBM Cloud account, sign up for IBM Cloud.

2. Clone the repo

  1. Click Clone or download button. Then, Download ZIP.

Clone

  1. Right click on the downloaded .zip folder and click Extract All.

3. Twitter requirements

To get Tweets from a specific handle in this application, it is required to create a Twitter account and a Twitter application. The Twitter account will be used as the account that gets the tweets from other Twitter users.

  • You can create an account on Twitter or use an existing account.
  • Once you have the Twitter account created and verified, log in to Twitter Dev and create an application.
  • Select the Keys and Access Tokens tab and copy your API Key and API Secret.
  • In app.js file, paste your keys to consumer_key and consumer_secret:
var Twithelper = new Twit({
  consumer_key: 'Your key',
  consumer_secret: 'Your secret',
  app_only_auth: true
})

Twitter app

4. Create Watson Personality Insights service with IBM Cloud

  1. Log into IBM Cloud with your account.
  2. Create Personality Insights service.
  • From the top bar menu, click Catalog.
  • On the left menu, select Watson.
  • Select Personality Insights.
  • Click Create.
  1. Once the application is created, go into the application and select Service credentials.
  2. Click View credentials to copy your username and password into the code in app.js:
var personality_insights = watson.personality_insights({
  username: 'Your username',
  password: 'Your password',
  version_date:'2016-10-19',
  version: 'v3'
});

Watson service

5. Run the application

  1. Open the manifest.yml file and change the name AND host value to a unique application name.

  2. Download and install the Bluemix CLI tool.

  3. Now open Command Prompt app and go to the directory of eCommerce with Watson folder in your computer.

cd C:\Users\%username%\Downloads\eCommerce-with-Watson-master
  1. Then, connect to IBM Cloud and follow the prompts to log in.
bx login
  1. Specify your targeted organization and space. You can find it in IBM Cloud Dashboard.

Organization and Space

bx target -o nora.alnashwan -s dev
  1. Push the app to IBM Cloud.
bx app push
  1. The application should now be running on IBM Cloud. Running

Congrats! 😄 Now you can access the application from the route specified in your IBM Cloud Dashboard.

App

Contributors

Thanks goes to these wonderful people:


Nora AlNashwan

💻 📖

Rackad AlRasheed

🤔 📖

This project follows the all-contributors specification. Contributions of any kind are welcome!

About

A Demo on Using Watson Personality Insight

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published