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.
- User enters a Twitter handle name and click
Find!
button. - Tweets are pushed out by Twitter.
- The app (app.js) processes the tweets.
- The Watson personality Insights Service performs analysis of consumption needs.
- The Web UI displays products that matches user consumption needs and preferences.
- 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.
- 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.
The setup is done in 3 primary steps. You will download the code, setup the application and then deploy the code to IBM Cloud.
- Sign up on IBM Cloud
- Clone the repo
- Twitter Requirements
- Create Watson Personality Insights service with IBM Cloud
- Run the application
If you do not already have an IBM Cloud account, sign up for IBM Cloud.
- Click
Clone or download
button. Then,Download ZIP
.
- Right click on the downloaded
.zip
folder and clickExtract All
.
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
andAPI Secret
. - In
app.js
file, paste your keys toconsumer_key
andconsumer_secret
:
var Twithelper = new Twit({
consumer_key: 'Your key',
consumer_secret: 'Your secret',
app_only_auth: true
})
- Log into IBM Cloud with your account.
- Create
Personality Insights
service.
- From the top bar menu, click
Catalog
. - On the left menu, select
Watson
. - Select
Personality Insights
. - Click
Create
.
- Once the application is created, go into the application and select
Service credentials
. - Click
View credentials
to copy your username and password into the code inapp.js
:
var personality_insights = watson.personality_insights({
username: 'Your username',
password: 'Your password',
version_date:'2016-10-19',
version: 'v3'
});
-
Open the
manifest.yml
file and change thename
ANDhost
value to a unique application name. -
Download and install the Bluemix CLI tool.
-
Now open
Command Prompt
app and go to the directory ofeCommerce with Watson
folder in your computer.
cd C:\Users\%username%\Downloads\eCommerce-with-Watson-master
- Then, connect to IBM Cloud and follow the prompts to log in.
bx login
- Specify your targeted organization and space. You can find it in IBM Cloud Dashboard.
bx target -o nora.alnashwan -s dev
- Push the app to IBM Cloud.
bx app push
Congrats! 😄 Now you can access the application from the route specified in your IBM Cloud Dashboard.
Thanks goes to these wonderful people:
Nora AlNashwan 💻 📖 |
Rackad AlRasheed 🤔 📖 |
---|
This project follows the all-contributors specification. Contributions of any kind are welcome!