summaryrefslogtreecommitdiff
path: root/src/main/TweetShell.java
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-05-07 13:01:56 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-05-07 13:01:56 +0200
commit27d2376ce73158409e232ffbc4e156b4162281e3 (patch)
treed8ec2de2304e677370339f1f8b6511aae23938b7 /src/main/TweetShell.java
parent489df8f0dd22043507299d02f934fe0213ca29e6 (diff)
downloadTwitterDataAnalytics-27d2376ce73158409e232ffbc4e156b4162281e3.tar.gz
Display user for tweet, strip whitespace around keyword
Diffstat (limited to 'src/main/TweetShell.java')
-rw-r--r--src/main/TweetShell.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/TweetShell.java b/src/main/TweetShell.java
index e8d387d..a86bad3 100644
--- a/src/main/TweetShell.java
+++ b/src/main/TweetShell.java
@@ -93,7 +93,10 @@ public class TweetShell implements TwitterApi.PinSupplier {
@Override
public void tweetGenerated(JSONObject obj) {
try {
- System.out.println("Got tweet: " + obj.getString("text"));
+ JSONObject userObj = obj.getJSONObject("user");
+ System.out.println("Got tweet: "
+ + userObj.getString("screen_name") + ": "
+ + obj.getString("text"));
} catch (JSONException ex) {
getLogger().log(Level.SEVERE, "Failed to parse tweet", ex);
}