Giter Site home page Giter Site logo

chrisemoulton / yourcelebritymatch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from germanattanasio/your-celebrity-match

0.0 1.0 0.0 686 KB

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.

Home Page: http://your-celebrity-match.mybluemix.net/

License: Apache License 2.0

JavaScript 49.41% CSS 22.86% HTML 27.74%

yourcelebritymatch's Introduction

your-celebrity-match

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.

The application is running in 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.

Deploy to Bluemix

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. Get the code by downloading this file or cloning the git repository with:

    $ git clone [email protected]: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. 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.

    Instructions on how to create an app and get Twitter credentials here(you can use more than one Twitter app ;-) ).

  7. Start the app

    $ node app.js
  8. Update 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 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 and @nfriedly. If you want to add more profiles you will have to:

  1. 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.
  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 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

yourcelebritymatch's People

Contributors

germanattanasio avatar nfriedly avatar tparikh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.