|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecttwitter4j.TwitterSupport
twitter4j.TwitterStream
public class TwitterStream
A java reporesentation of the Twitter Streaming API
| Nested Class Summary | |
|---|---|
(package private) class |
TwitterStream.StreamHandlingThread
|
| Field Summary | |
|---|---|
private static boolean |
DEBUG
|
private TwitterStream.StreamHandlingThread |
handler
|
private int |
retryPerMinutes
|
private StatusListener |
statusListener
|
| Fields inherited from class twitter4j.TwitterSupport |
|---|
http, source, USE_SSL |
| Constructor Summary | |
|---|---|
TwitterStream()
Constructs a TwitterStream instance. |
|
TwitterStream(java.lang.String userId,
java.lang.String password)
|
|
TwitterStream(java.lang.String userId,
java.lang.String password,
StatusListener listener)
|
|
| Method Summary | |
|---|---|
void |
birddog(int count,
int[] follow)
Deprecated. use filter() instead |
void |
cleanup()
|
void |
filter(int count,
int[] follow,
java.lang.String[] track)
See birddog above. |
void |
firehose(int count)
Starts listening on all public statuses. |
void |
follow(int[] follow)
Deprecated. use filter() instead |
void |
gardenhose()
Deprecated. use sample() instead |
StatusStream |
getBirddogStream(int count,
int[] follow)
Deprecated. use filterStream() instead |
StatusStream |
getFilterStream(int count,
int[] follow,
java.lang.String[] track)
Returns stream of public statuses that match one or more filter predicates. |
StatusStream |
getFirehoseStream(int count)
Returns a status stream of all public statuses. |
StatusStream |
getFollowStream(int[] follow)
Deprecated. use filterStream() instead |
StatusStream |
getGardenhoseStream()
Deprecated. use sampleStream() instead |
StatusStream |
getRetweetStream()
Returns a stream of all retweets. |
StatusStream |
getSampleStream()
Returns a stream of random sample of all public statuses. |
StatusStream |
getShadowStream(int count,
int[] follow)
Deprecated. use filterStream() instead |
StatusStream |
getSpritzerStream()
Deprecated. use sampleStream() instead |
StatusListener |
getStatusListener()
|
private java.lang.String |
getStreamBaseURL()
|
StatusStream |
getTrackStream(java.lang.String[] keywords)
Deprecated. use filterStream() instead |
private void |
log(java.lang.String message)
|
private void |
log(java.lang.String message,
java.lang.String message2)
|
void |
retweet()
Starts listening on all retweets. |
void |
sample()
Starts listening on random sample of all public statuses. |
void |
setStatusListener(StatusListener statusListener)
|
void |
shadow(int count,
int[] follow)
Deprecated. use filter() instead |
void |
spritzer()
Deprecated. use sample() instead |
private void |
startHandler(TwitterStream.StreamHandlingThread handler)
|
private java.lang.String |
toFollowString(int[] follows)
|
private java.lang.String |
toTrackString(java.lang.String[] keywords)
|
void |
track(java.lang.String[] keywords)
Deprecated. use filter() instead |
| Methods inherited from class twitter4j.TwitterSupport |
|---|
forceUsePost, getClientURL, getClientVersion, getPassword, getSource, getUserAgent, getUserId, isUsePostForced, setClientURL, setClientVersion, setHttpConnectionTimeout, setHttpProxy, setHttpProxyAuth, setHttpReadTimeout, setPassword, setRequestHeader, setRetryCount, setRetryIntervalSecs, setSource, setUserAgent, setUserId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG
private StatusListener statusListener
private TwitterStream.StreamHandlingThread handler
private int retryPerMinutes
| Constructor Detail |
|---|
public TwitterStream()
public TwitterStream(java.lang.String userId,
java.lang.String password)
public TwitterStream(java.lang.String userId,
java.lang.String password,
StatusListener listener)
| Method Detail |
|---|
public void firehose(int count)
throws TwitterException
count - Indicates the number of previous statuses to stream before transitioning to the live stream.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - firehose
public StatusStream getFirehoseStream(int count)
throws TwitterException
count - Indicates the number of previous statuses to stream before transitioning to the live stream.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - firehose
public void retweet()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - retweet
public StatusStream getRetweetStream()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - firehose
public void sample()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - sample
public StatusStream getSampleStream()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - sample
public void filter(int count,
int[] follow,
java.lang.String[] track)
throws TwitterException
count - Indicates the number of previous statuses to stream before transitioning to the live stream.follow - Specifies the users, by ID, to receive public tweets from.track - Specifies keywords to track.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - filter
public StatusStream getFilterStream(int count,
int[] follow,
java.lang.String[] track)
throws TwitterException
follow - Specifies the users, by ID, to receive public tweets from.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - filter
public void gardenhose()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - gardenhose
public StatusStream getGardenhoseStream()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - gardenhose
public void spritzer()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - spritizer
public StatusStream getSpritzerStream()
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - spritizer
public void birddog(int count,
int[] follow)
throws TwitterException
count - Indicates the number of previous statuses to stream before transitioning to the live stream.follow - Specifies the users, by ID, to receive public tweets from.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - birddog
public StatusStream getBirddogStream(int count,
int[] follow)
throws TwitterException
count - Indicates the number of previous statuses to stream before transitioning to the live stream.follow - Specifies the users, by ID, to receive public tweets from.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - birddog
public void shadow(int count,
int[] follow)
throws TwitterException
count - Indicates the number of previous statuses to stream before transitioning to the live stream.follow - Specifies the users, by ID, to receive public tweets from.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - shadow
public StatusStream getShadowStream(int count,
int[] follow)
throws TwitterException
count - Indicates the number of previous statuses to stream before transitioning to the live stream.follow - Specifies the users, by ID, to receive public tweets from.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - shadow
public void follow(int[] follow)
throws TwitterException
follow - Specifies the users, by ID, to receive public tweets from.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - follow
public StatusStream getFollowStream(int[] follow)
throws TwitterException
follow - Specifies the users, by ID, to receive public tweets from.
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - followprivate java.lang.String toFollowString(int[] follows)
public void track(java.lang.String[] keywords)
throws TwitterException
TwitterException - when Twitter service or network is unavailableStatusStream,
Twitter API Wiki / Streaming API Documentation - spritizer
public StatusStream getTrackStream(java.lang.String[] keywords)
throws TwitterException
TwitterExceptiongetTrackStream(String[])private java.lang.String toTrackString(java.lang.String[] keywords)
private void startHandler(TwitterStream.StreamHandlingThread handler)
throws TwitterException
TwitterExceptionpublic void cleanup()
public StatusListener getStatusListener()
public void setStatusListener(StatusListener statusListener)
private java.lang.String getStreamBaseURL()
private void log(java.lang.String message)
private void log(java.lang.String message,
java.lang.String message2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||