Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

yourcelebritymatch

:star2:The Celebrity Match application uses the Watson Personality insights Service and Twitter data to identify celebrities on Twitter whose tweets are conceptually closest to yours.

Subscribe to updates I use yourcelebritymatch


Statistics on yourcelebritymatch

Number of watchers on Github 139
Number of open issues 0
Average time to close an issue 18 days
Main language JavaScript
Average time to merge a PR about 13 hours
Open pull requests 4+
Closed pull requests 32+
Last commit over 1 year ago
Repo Created almost 5 years ago
Repo Last Updated almost 2 years ago
Size 823 KB
Homepage https://your-cele...
Organization / Authorwatson-developer-cloud
Latest Releasev2.2.1
Contributors5
Page Updated
Do you use yourcelebritymatch? Leave a review!
View yourcelebritymatch activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating yourcelebritymatch for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

your-celebrity-match

Build Status

The application uses IBM Watson Personality Insights 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.

Live demo: http://your-celebrity-match.ng.bluemix.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.
Deploy to Bluemix
Note: Once you deploy the application in Bluemix you will need to do some extra steps described below to setup the database and Twitter API credentials.

API Reference:

The application uses The Personality Insights API

How it works

Steps
You input your Twitter handle
You input your Twitter handle.
Calls the Twitter API.
Calls the Twitter API to get the latest 2300 tweets from your public feed.
Calls the Personality Insights API.
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.
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.
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.

  1. Clone the repository with:

    $ git clone git@github.com:watson-developer-cloud/yourcelebritymatch.git
    
  2. Install node (use v0.10.31)

  3. Install mongodb

  4. Install the npm modules:

    $ npm install
    

    Note: Make sure you are in the project directory, the package.json file should be visible.

  5. Start mongodb

    $ mongod
    

    (Run this in a separate terminal window)

  6. You need some credentials to use Twitter API, Personality Insights and MongoDC:

    • Get credentials to use Personality Insights, instructions here.
    • Create a FREE Mongodb database using MongoLab.
    • Create a Twitter app and get the API credentials here.
  7. Update the Twitter, MongoDB and Personality Insights credentials in config/config.js

    mongodb: process.env.MONGODB || 'mongodb://localhost/celebs',
    
    {
      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>'
      }]
    }
    
  8. Start the app

    $ npm start
    
  9. Update the database with the celebrities by making a POST request to:

    http://localhost:3000/celebrities/syncdb

    The celebrities are not added by default. Hence the above step is recommended. Refer #Celebrities section below for more information. When running in bluemix make sure the environment variable DEMO is set to 0.

  10. You can add additional celebrities to the database as long as they are verified, have at least 10,000 followers, and have over 1,000 tweets. To add another celebrity, make a POST request to:

    http://localhost:3000/celebrities/add/@username
    

    where username is the Twitter handle of the celebrity you would like to add.

Personality Insights Credentials

The credentials for the services are stored in the VCAP_SERVICES 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 'celebrity' profiles: @germanatt and @nfriedly. If you want to add more profiles, you have two options:

Auto-Lookup

  1. Choose a person on Twitter to include as a 'celebrity'. Ensure this person is verified, has at least 10,000 followers, and has over 1,000 tweets.
  2. Make a POST request to:

    http://localhost:3000/celebrities/add/@username
    

    where username is the Twitter handle of the celebrity you would like to add.

SyncDB

  1. Choose a person to include as a 'celebrity'. You need at least 100 different words written by that person. Blog posts, tweets, text messages, emails will work.
  2. Get the profile by using the Personality Insights service with the text you have and save the json profile in the profiles folder. Make sure the file has the .json extension as in the examples provided.
  3. Start the app and make a POST request to: http://localhost:3000/celebrities/syncdb. It will repopulate the application database and add the new profile. Be aware that this command will erase all celebrities previously added to the database.

Note: In order to add celebrities, you must not be running the app in demo mode. Either run the app locally or set the DEMO environment variable to 0 when running the app on Bluemix.

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

yourcelebritymatch open pull requests (View All Pulls)
  • watson-developer-cloud@1.2.3 untested ⚠️
  • watson-developer-cloud@1.2.2 untested ⚠️
  • body-parser@1.15.0 untested ⚠️
  • mongoose@4.4.3 untested ⚠️
yourcelebritymatch list of languages used
Other projects in JavaScript