your-celebrity-match
The application uses IBM Watson [Personality Insights][pi_docs] and Twitter to find the celebrities that are similar to your personality. Twitter is being use to get the tweets for a given handler, the text from those tweets is send to Personality Insights, who analyze the text and reply with a personality profile. That profile is compared to celebrity profiles to find the most similar.
The application is running in [Bluemix][bluemix].
Live demo: http://your-celebrity-match.mybluemix.net/
Give it a try! Click the button below to fork into IBM DevOps Services and deploy your own copy of this application on Bluemix.
How it works
| Steps |
|---|
![]() You input your Twitter handle. |
![]() Calls the Twitter API to get the latest 2300 tweets from your public feed. |
![]() Calls the Personality Insights API to analyze the language in your tweets and apply it to a spectrum of characteristics. |
![]() Compares your Personality Insights profile to 232 celebrity profiles analyzed with the service. |
![]() Sorts your matches and shows you the highest and lowest. These are calculated by the euclidean distance between the two. |
Getting Started
This instructions will help you install the celebrities app in your local environment.
Get the code by downloading this [file][code_zip] or cloning the git repository with:
$ git clone git@github.com:watson-developer-cloud/yourcelebritymatch.gitInstall [node]node
Install [mongodb][mongodb]
Install the npm modules:
$ npm installNote: Make sure you are in the project directory, the
package.jsonfile should be visible.Start mongodb
$ mongod(Run this in a separate terminal window)
Update the Twitter and Personality Insights credentials in
config/config.js{ personality_insights: { url: '<url>', username: '<username>', password: '<password>' }, twitter: [{ consumer_key: '<consumer_key>', consumer_secret: '<consumer_secret>', access_token_key: '<access_token_key>', access_token_secret:'<access_token_secret>' }] }Instructions on how to create an app and get Personality Insights credentials [here][um_cred].
Instructions on how to create an app and get Twitter credentials [here]twitter_app ).
Start the app
$ node app.jsUpdate the database with the celebrities by going to:
http://localhost:3000/celebrities/syncdb
Personality Insights Credentials
The credentials for the services are stored in the [VCAP_SERVICES][vcap_environment] environment variable. In order to get them you need to first create and bind the service to your application.
There are two ways to get the credentials, you can use Bluemix to access your app and view the VCAP_SERVICES there or you can run:
$ cf env <application-name>
Example output:
System-Provided:
{
"VCAP_SERVICES": {
"personality_insights": [{
"credentials": {
"password": "<password>",
"url": "<url>",
"username": "<username>"
},
"label": "personality_insights",
"name": "personality-insights-service",
"plan": "IBM Watson Personality Insights Monthly Plan"
}]
}
}
You need to copy username, password.
Celebrities
The application comes with two profiles: [@germanatt][german_twitter] and [@nfriedly][nathan_twitter]. If you want to add more profiles you will have to:
- Choose a person to include as 'celebrity'. You need at least 100 different words writted by that person, blog posts, tweets, text messages, emails will work.
- Get the profile by using the [Personality Insights][pi_docs] service with the text you have and save the json profile in the
profilesfolder. Make sure the file has the.jsonextension as in the examples provided. - Start the app and go to:
http://localhost:3000/celebrities/syncdb. It will repopulate the application database and add the new profile.
License
This sample code is licensed under Apache 2.0. Full license text is available in LICENSE.
Contributing
See CONTRIBUTING.
Open Source @ IBM
Find more open source projects on the IBM Github Page
[bluemix]: https://console.ng.bluemix.net/ [code_zip]: https://github.rtp.raleigh.ibm.com/gattana-us/yourcelebritymatch/repository/archive.zip [node]: http://nodejs.org/download [mongodb]: http://docs.mongodb.org/manual/installation/ [um_cred]: https://github.com/watson-developer-cloud/um-ruby/blob/master/README.md [twitter_app]: https://apps.twitter.com/app/new [german_twitter]: https://twitter.com/germanatt [nathan_twitter]: https://twitter.com/nfriedly [pi_docs]: http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/personality-insights/ [vcap_environment]: https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/getting_started/#VcapEnvVar






Log in or sign up for Devpost to join the conversation.