Here is how it works
- Both Twitter usernames (handles) are checked to make sure they're valid.
- A call to the Twitter API retrieves the first 200 tweets from your Twitter feed (excluding any retweets).
- A call to the Twitter API retrieves the first 200 tweets from the celebrity's Twitter feed (excluding retweets).
- Your 200 tweets are sent as a single body of text to the Watson Personality Insights (PI) API to be analyzed.
- The celebrity's 200 tweets are sent as a single body of text to the Watson Personality Insights (PI) API to be analyzed.
6.The Watson PI API runs a sorting & matching algorithm to find the most common attributes between both bodies of text.
7.The application prints the results to the user.
The application does the following:
-
Accepts two Twitter usernames as variables.
-
Retrieves the last 200 Tweets from each Twitter username.
-
Sends the text of the 200 Tweets to the Personality Insights (PI) API to gain insights on the two users.
-
Compares the users to one another.
-
Displays the results of the comparison.
The final results displayed will be the top 5 traits shared between the two Twitter users (for example: you and a celebrity of your choice).