twitter

Class TwitterTrending

  • java.lang.Object
    • twitter.TwitterTrending


  • public class TwitterTrending
    extends java.lang.Object
    Sample twitter trending topology application. This Java application builds a topology that reads from a file of tweets, extracts the hashtags from each line, and uses a window to keep track of the most popular hashtags from the past 40,000 tweets.

    Although the application reads from a file, in principle it could be attached to a live data source.

    If no arguments are provided then the topology is executed in embedded mode, within this JVM.
    This may be executed from the samples/java/functional directory as:

    • ant run.twitter.trending - Using Apache Ant, this will run in embedded mode and assumes tweets are in CSV files in $HOME/tweets.
    • java -cp functionalsamples.jar:../../../com.ibm.streamsx.topology/lib/com.ibm.streamsx.topology.jar:$STREAMS_INSTALL/lib/com.ibm.streams.operator.samples.jar twitter.TwitterTrending CONTEXT_TYPE DIRECTORY - Run directly from the command line.
    • CONTEXT_TYPE is one of:
      • DISTRIBUTED - Run as an IBM Streams distributed application.
      • STANDALONE - Run as an IBM Streams standalone application.
      • EMBEDDED - Run embedded within this JVM.
      • BUNDLE - Create an IBM Streams application bundle.
      • TOOLKIT - Create an IBM Streams application toolkit.
      and DIRECTORY is the location of a directory that contains one or more text files containing lines of tweets.
    • An application execution within your IDE once you set the class path to include the correct jars.

    • Constructor Summary

      Constructors 
      Constructor and Description
      TwitterTrending() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void main(java.lang.String[] args) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
streamsx.topology @ IBMStreams GitHub