|
|||||||||
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
|
private static java.lang.String |
STREAM_BASE_URL
|
Fields inherited from class twitter4j.TwitterSupport |
---|
http, source |
Constructor Summary | |
---|---|
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)
Starts listening on public statuses from a specified set of users, by ID. |
void |
cleanup()
|
void |
firehose(int count)
Starts listening on all public statuses. |
void |
follow(int[] follow)
See birddog above. |
void |
gardenhose()
Starts listening on a percentage of all public statuses, suitable for data mining and research applications that require a statistically significant sample. |
StatusStream |
getBirddogStream(int count,
int[] follow)
Returns a status stream for public statuses from a specified set of users, by ID. |
StatusStream |
getFirehoseStream(int count)
Returns a status stream for all public statuses. |
StatusStream |
getFollowStream(int[] follow)
See birddog above. |
StatusStream |
getGardenhoseStream()
Returns a status stream for a percentage of all public statuses, suitable for data mining and research applications that require a statistically significant sample. |
StatusStream |
getShadowStream(int count,
int[] follow)
See birddog above. |
StatusStream |
getSpritzerStream()
Returns a status stream for a percentage of all public statuses, suitable for small projects that don't require a statistically significant sample. |
StatusListener |
getStatusListener()
|
StatusStream |
getTrackStream(java.lang.String[] keywords)
|
private void |
log(java.lang.String message)
|
private void |
log(java.lang.String message,
java.lang.String message2)
|
void |
setStatusListener(StatusListener statusListener)
|
void |
shadow(int count,
int[] follow)
See birddog above. |
void |
spritzer()
Starts listening on a percentage of all public statuses, suitable for small projects that don't require a statistically significant sample. |
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)
Returns public statuses that contain at least one of the specified keywords. |
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 static final java.lang.String STREAM_BASE_URL
private StatusListener statusListener
private TwitterStream.StreamHandlingThread handler
private int retryPerMinutes
Constructor Detail |
---|
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 - firehosepublic 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 - firehosepublic void gardenhose() throws TwitterException
TwitterException
- when Twitter service or network is unavailableStatusStream
,
Twitter API Wiki / Streaming API Documentation - gardenhosepublic StatusStream getGardenhoseStream() throws TwitterException
TwitterException
- when Twitter service or network is unavailableStatusStream
,
Twitter API Wiki / Streaming API Documentation - gardenhosepublic void spritzer() throws TwitterException
TwitterException
- when Twitter service or network is unavailableStatusStream
,
Twitter API Wiki / Streaming API Documentation - spritizerpublic StatusStream getSpritzerStream() throws TwitterException
TwitterException
- when Twitter service or network is unavailableStatusStream
,
Twitter API Wiki / Streaming API Documentation - spritizerpublic 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 - birddogpublic 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 - birddogpublic 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 - shadowpublic 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 - shadowpublic 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 - followpublic 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 - spritizerpublic StatusStream getTrackStream(java.lang.String[] keywords) throws TwitterException
TwitterException
getTrackStream(String[])
private java.lang.String toTrackString(java.lang.String[] keywords)
private void startHandler(TwitterStream.StreamHandlingThread handler) throws TwitterException
TwitterException
public void cleanup()
public StatusListener getStatusListener()
public void setStatusListener(StatusListener statusListener)
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 |