Class TwitterFilterStreamReader
TwitterStreamReader
com.northconcepts.datapipeline.twitter.TwitterFilterStreamReader
public class TwitterFilterStreamReader
extends TwitterStreamReader
Continuously reads tweets matching several criteria (hashtag, user, language, etc.)
-
Constructor Summary
ConstructorsConstructorDescriptionTwitterFilterStreamReader(String consumerKey, String consumerSecret) TwitterFilterStreamReader(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret) -
Method Summary
Modifier and TypeMethodDescriptionaddExceptionProperties(DataException exception) voidclose()long[]Returns the IDs of the users the stream is filtered by.String[]double[][]longReturns the total of the limited-tweet counts reported by track limitation notices.String[]getTrack()Returns the keywords the stream is filtered by.booleanIndicates if track limitation notices fail the reader rather than only being counted (default is false).protected voidlisten(TwitterStream twitterStream) setFailOnLimitationNotice(boolean failOnLimitationNotice) Indicates if track limitation notices fail the reader rather than only being counted (default is false).setFollow(long... follow) Sets the IDs of the users the stream is filtered by.setLanguage(String... language) setLocations(double[]... locations) Sets the keywords the stream is filtered by.
-
Constructor Details
-
TwitterFilterStreamReader
-
TwitterFilterStreamReader
-
TwitterFilterStreamReader
-
-
Method Details
-
getFollow
public long[] getFollow()Returns the IDs of the users the stream is filtered by. -
setFollow
Sets the IDs of the users the stream is filtered by. -
getTrack
Returns the keywords the stream is filtered by. -
setTrack
Sets the keywords the stream is filtered by. -
getLocations
public double[][] getLocations() -
setLocations
-
getLanguage
-
setLanguage
-
isFailOnLimitationNotice
public boolean isFailOnLimitationNotice()Indicates if track limitation notices fail the reader rather than only being counted (default is false). -
setFailOnLimitationNotice
Indicates if track limitation notices fail the reader rather than only being counted (default is false). -
getMissedTweets
public long getMissedTweets()Returns the total of the limited-tweet counts reported by track limitation notices. -
listen
protected void listen(TwitterStream twitterStream) -
close
- Throws:
DataException
-
addExceptionProperties
-