This is micro example (less than 25 lines) to fetch a user's interests based on his tweets.
For a user:
-
Get timeline of user (and timeline of everyone he follows but Twitter API rate limit throws a spanner)
-
Fold text of tweets and convert to lowercase
-
Filter out non a-z chars and split into words
-
Filter out commonly used english words and create frequency map
-
Discard non-frequent words and return word-frequency list
make sure to create twitter4j.properties
file in src/main/resources