Class TwitterFilterStreamReader

TwitterStreamReader
com.northconcepts.datapipeline.twitter.TwitterFilterStreamReader

public class TwitterFilterStreamReader extends TwitterStreamReader
Continuously reads tweets matching several criteria (hashtag, user, language, etc.)
  • Constructor Details

    • TwitterFilterStreamReader

      public TwitterFilterStreamReader(TwitterStreamProvider provider)
    • TwitterFilterStreamReader

      public TwitterFilterStreamReader(String consumerKey, String consumerSecret)
    • TwitterFilterStreamReader

      public TwitterFilterStreamReader(String consumerKey, String consumerSecret, String accessToken, String accessTokenSecret)
  • Method Details

    • getFollow

      public long[] getFollow()
      Returns the IDs of the users the stream is filtered by.
    • setFollow

      public TwitterFilterStreamReader setFollow(long... follow)
      Sets the IDs of the users the stream is filtered by.
    • getTrack

      public String[] getTrack()
      Returns the keywords the stream is filtered by.
    • setTrack

      public TwitterFilterStreamReader setTrack(String... track)
      Sets the keywords the stream is filtered by.
    • getLocations

      public double[][] getLocations()
    • setLocations

      public TwitterFilterStreamReader setLocations(double[]... locations)
    • getLanguage

      public String[] getLanguage()
    • setLanguage

      public TwitterFilterStreamReader setLanguage(String... language)
    • isFailOnLimitationNotice

      public boolean isFailOnLimitationNotice()
      Indicates if track limitation notices fail the reader rather than only being counted (default is false).
    • setFailOnLimitationNotice

      public TwitterFilterStreamReader setFailOnLimitationNotice(boolean failOnLimitationNotice)
      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

      public void close() throws DataException
      Throws:
      DataException
    • addExceptionProperties

      public DataException addExceptionProperties(DataException exception)