diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-05-02 13:35:43 +0200 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-05-02 13:35:43 +0200 |
commit | 125d8d251de88d2522a849e02b92071177ba00ae (patch) | |
tree | 83070ae337ee66556a3c908590bec29bee299a90 /src/main/TweetShell.java | |
parent | db80ae2107b658923ef894adb3679ea2fe4cab63 (diff) | |
download | TwitterDataAnalytics-125d8d251de88d2522a849e02b92071177ba00ae.tar.gz |
Basic stats for tweets
Diffstat (limited to 'src/main/TweetShell.java')
-rw-r--r-- | src/main/TweetShell.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/TweetShell.java b/src/main/TweetShell.java index 12814b0..3ab1397 100644 --- a/src/main/TweetShell.java +++ b/src/main/TweetShell.java @@ -168,6 +168,7 @@ public class TweetShell implements TwitterApi.PinSupplier { del("Deletes a keyword from search", 1), keywords("Display currently active keywords"), commit("Activate the stream or apply the stream keyword changes"), + status("Show some status and statistics"), close("Close the stream"), exit("Returns to shell"), help("Get help"), @@ -253,6 +254,16 @@ public class TweetShell implements TwitterApi.PinSupplier { case commit: getStream().commit(); break; + case status: + TweetCounter tc; + tc = (TweetCounter) resultListeners.findListener(TweetCounter.class); + if (stream_cached != null && getStream().isValid()) { + System.out.println("Streaming is active."); + } else { + System.out.println("Streaming is inactive."); + } + System.out.println("Received tweets in session: " + tc.getTweetCount()); + break; case close: getStream().close(); break; |