def main():
    plotter = Plotter("out.png", "The plot", "some", "thing", 10, 60)
    plotter.addPlotItem("Source1", "#F01020", dataSource1)
    plotter.addPlotItem("Source2", "#201020", dataSource2)
    #plotter.begin()
    stopEvent = threading.Event()
    
    tweeter = TwitterPlotBot('api/app key', 'api/app secret',
                             'access key', 
                             'access secret',
                             '#pause', '#resume', plotter, stopEvent, '@navin_bhaskar', 500, False)
    time.sleep(120)
    print "Plotting..."
    tweeter.start()
    time.sleep(1900)
    print "Stopping it....."
    stopEvent.set()
    tweeter.join()
Exemplo n.º 2
0
def main():
    """ This is the enrty point for our application,
    "TwitterBot" """
    global plotter
    plotter = Plotter(config.config["output file"], # The output file name
                      config.config["title"],  # Title of the plot
                      config.config["xlabel"], # X axis label
                      config.config["ylabel"], # Y axis label
                      config.config["samples"], # Max number of samples to be taken
                      config.config["Log Interval"], # Log interval
                      )
                      
    # Now that we have the plotter, it is time to add items to it
    for callback in CallBacks.callbacks:
        plotter.addPlotItem(callback[0], callback[2], callback[1])
    
    

    twitterBot = TwitterPlotBot(config.config["consumer key"],
                                config.config["consumer secret"],
                                config.config["access token"],
                                config.config["access token secret"],
                                config.config["stop plot cmd"],
                                config.config["resume plot cmd"],
                                plotter,
                                stopEvent,
                                config.config["screen id"],
                                config.config["Tweet Interval"],
                                False)
    
    # Wait for some time until we have atleast one data point to plot
    time.sleep(config.config["Log Interval"])
    
    twitterBot.start()
    while True:
        pass