|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttwitter4j.TwitterStream
public class TwitterStream
A java reporesentation of the Twitter Streaming API
| Field Summary | |
|---|---|
protected HttpClient |
http
|
protected java.lang.String |
source
|
protected boolean |
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 |
forceUsePost(boolean forceUsePost)
Deprecated. some methods don't accept POST method anymore |
void |
gardenhose()
Deprecated. use sample() instead |
StatusStream |
getBirddogStream(int count,
int[] follow)
Deprecated. use filterStream() instead |
java.lang.String |
getClientURL()
|
java.lang.String |
getClientVersion()
|
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 |
java.lang.String |
getPassword()
Returns authenticating password |
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 |
java.lang.String |
getSource()
Returns the source |
StatusStream |
getSpritzerStream()
Deprecated. use sampleStream() instead |
StatusListener |
getStatusListener()
|
StatusStream |
getTrackStream(java.lang.String[] keywords)
Deprecated. use filterStream() instead |
java.lang.String |
getUserAgent()
|
java.lang.String |
getUserId()
Returns authenticating userid |
boolean |
isUsePostForced()
|
void |
retweet()
Starts listening on all retweets. |
void |
sample()
Starts listening on random sample of all public statuses. |
void |
setClientURL(java.lang.String clientURL)
Sets the X-Twitter-Client-URL header. |
void |
setClientVersion(java.lang.String version)
Sets the X-Twitter-Client-Version header. |
void |
setHttpConnectionTimeout(int connectionTimeout)
Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the Twitter API. |
void |
setHttpProxy(java.lang.String proxyHost,
int proxyPort)
Enables use of HTTP proxy |
void |
setHttpProxyAuth(java.lang.String proxyUser,
java.lang.String proxyPass)
Adds authentication on HTTP proxy |
void |
setHttpReadTimeout(int readTimeoutMilliSecs)
Sets the read timeout to a specified timeout, in milliseconds. |
void |
setPassword(java.lang.String password)
Sets the password |
void |
setRequestHeader(java.lang.String name,
java.lang.String value)
Sets the request header name/value combination see Twitter Fan Wiki for detail. |
void |
setRetryCount(int retryCount)
|
void |
setRetryIntervalSecs(int retryIntervalSecs)
|
void |
setSource(java.lang.String source)
Sets X-Twitter-Client http header and the source parameter that will be passed by updating methods. |
void |
setStatusListener(StatusListener statusListener)
|
void |
setUserAgent(java.lang.String userAgent)
Sets the User-Agent header. |
void |
setUserId(java.lang.String userId)
Sets the userid |
void |
shadow(int count,
int[] follow)
Deprecated. use filter() instead |
void |
spritzer()
Deprecated. use sample() instead |
void |
track(java.lang.String[] keywords)
Deprecated. use filter() instead |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HttpClient http
protected java.lang.String source
protected final boolean USE_SSL
| 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 - follow
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[])public void cleanup()
public StatusListener getStatusListener()
public void setStatusListener(StatusListener statusListener)
public void setUserAgent(java.lang.String userAgent)
userAgent - UserAgentpublic java.lang.String getUserAgent()
public void setClientVersion(java.lang.String version)
version - client versionpublic java.lang.String getClientVersion()
public void setClientURL(java.lang.String clientURL)
clientURL - client URLpublic java.lang.String getClientURL()
public void setUserId(java.lang.String userId)
userId - new useridpublic java.lang.String getUserId()
public void setPassword(java.lang.String password)
password - new passwordpublic java.lang.String getPassword()
public void setHttpProxy(java.lang.String proxyHost,
int proxyPort)
proxyHost - proxy host, can be overridden system property -Dtwitter4j.http.proxyHost , -Dhttp.proxyHostproxyPort - proxy port, can be overridden system property -Dtwitter4j.http.proxyPort , -Dhttp.proxyPort
public void setHttpProxyAuth(java.lang.String proxyUser,
java.lang.String proxyPass)
proxyUser - proxy user, can be overridden system property -Dtwitter4j.http.proxyUserproxyPass - proxy password, can be overridden system property -Dtwitter4j.http.proxyPasswordpublic void setHttpConnectionTimeout(int connectionTimeout)
connectionTimeout - an int that specifies the connect timeout value in millisecondspublic void setHttpReadTimeout(int readTimeoutMilliSecs)
readTimeoutMilliSecs - an int that specifies the timeout value to be used in millisecondspublic void setSource(java.lang.String source)
source - the new sourcepublic java.lang.String getSource()
public void setRequestHeader(java.lang.String name,
java.lang.String value)
name - the name of the request headervalue - the value of the request headerpublic void forceUsePost(boolean forceUsePost)
forceUsePost - if true POST method will be used forciblypublic boolean isUsePostForced()
public void setRetryCount(int retryCount)
public void setRetryIntervalSecs(int retryIntervalSecs)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||