|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwitter4j.TwitterStream
public final class TwitterStream
A java reporesentation of the Twitter Streaming API
Note that this class is NOT compatible with Google App Engine as GAE is not capable of handling requests longer than 30 seconds.
Field Summary | |
---|---|
protected Authorization |
auth
|
protected Configuration |
conf
|
Constructor Summary | |
---|---|
TwitterStream()
Deprecated. use new TwitterStreamFactory.getInstance() instead. |
|
TwitterStream(java.lang.String screenName,
java.lang.String password)
Deprecated. use new TwitterStreamFactory.getInstance() instead. |
|
TwitterStream(java.lang.String screenName,
java.lang.String password,
StatusListener listener)
Deprecated. use new TwitterStreamFactory.getInstance() instead. |
Method Summary | |
---|---|
void |
cleanup()
|
protected void |
ensureAuthorizationEnabled()
|
protected void |
ensureBasicEnabled()
|
boolean |
equals(java.lang.Object o)
|
void |
filter(int count,
int[] follow,
java.lang.String[] track)
Start consuming public statuses that match one or more filter predicates. |
void |
firehose(int count)
Starts listening on all public statuses. |
Authorization |
getAuthorization()
Returns the authorization scheme for this instance. The returned type will be either of BasicAuthorization, OAuthAuthorization, or NullAuthorization |
StatusStream |
getFilterStream(int count,
int[] follow,
java.lang.String[] track)
Returns public statuses that match one or more filter predicates. |
StatusStream |
getFirehoseStream(int count)
Returns a status stream of all public statuses. |
StatusStream |
getLinksStream(int count)
Returns a status stream of all public statuses containing links. |
StatusStream |
getRetweetStream()
Returns a stream of all retweets. |
StatusStream |
getSampleStream()
Returns a stream of random sample of all public statuses. |
int |
hashCode()
|
boolean |
isBasicAuthEnabled()
tests if the instance is authenticated by Basic |
void |
links(int count)
Starts listening on all public statuses containing links. |
void |
retweet()
Starts listening on all retweets. |
void |
sample()
Starts listening on random sample of all public statuses. |
void |
setStatusListener(StatusListener statusListener)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Configuration conf
protected Authorization auth
Constructor Detail |
---|
public TwitterStream()
public TwitterStream(java.lang.String screenName, java.lang.String password)
screenName
- screen namepassword
- passwordpublic TwitterStream(java.lang.String screenName, java.lang.String password, StatusListener listener)
screenName
- screen namepassword
- passwordlistener
- listenerMethod Detail |
---|
public void firehose(int count)
count
- Indicates the number of previous statuses to stream before transitioning to the live stream.StatusStream
,
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 links(int count)
count
- Indicates the number of previous statuses to stream before transitioning to the live stream.StatusStream
,
Twitter API Wiki / Streaming API Documentation - linkspublic StatusStream getLinksStream(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 - linkspublic void retweet()
StatusStream
,
Twitter API Wiki / Streaming API Documentation - retweetpublic StatusStream getRetweetStream() throws TwitterException
TwitterException
- when Twitter service or network is unavailableStatusStream
,
Twitter API Wiki / Streaming API Documentation - retweetpublic void sample()
StatusStream
,
Twitter API Wiki / Streaming API Documentation - samplepublic StatusStream getSampleStream() throws TwitterException
TwitterException
- when Twitter service or network is unavailableStatusStream
,
Twitter API Wiki / Streaming API Documentation - Samplingpublic void filter(int count, int[] follow, java.lang.String[] track)
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.StatusStream
,
Twitter API Wiki / Streaming API Documentation - filterpublic 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 - filterpublic void cleanup()
public void setStatusListener(StatusListener statusListener)
public final boolean isBasicAuthEnabled()
protected final void ensureAuthorizationEnabled()
protected final void ensureBasicEnabled()
public final Authorization getAuthorization()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |