This sample shows how to get Twitter data using the Twitter REST API (via the Twitter4j client library) and submit it to the Personality Insights Service.
For non-twitter samples and more details on how to setup your Personality Insights service in bluemix see the official Watson Developer Cloud sample.
To configure the sample, copy twittersample.properties.example
to twittersample.properties
and fill in
your Twitter and Personality Insights Credentials. Instructions are provided in the example properties file.
To build the code, use the provided gradle build file and wrapper configuration.
On Mac or Linux:
./gradlew build
On Windows:
./gradlew.bat build
To run the sample, run the TwitterAnalyzer java class and pass in a twitter user's handle (with an @ sign) or their numerical id.
Example:
java com.ibm.watson.personalityinsights.sample.twitter.TwitterAnalyzer @jschoudt