johnhamelink
4/21/2013 - 12:09 AM

cluster.rb


        do_some_stuff("Getting Posts from the past hour") { get_posts((Time.now-360000), Time.now) }
        do_some_stuff("Counting all the words in all the posts") { count_words @posts }
        do_some_stuff("Getting the top #{number} keywords from the wordlist") { get_keywords number }
        do_some_stuff("Getting the top #{number} documents for each keyword") { get_documents_with_keywords }
        do_some_stuff("Running k-means against documents for each keyword") { run_kmeans }

    end

    def self.do_some_stuff description, &block
        print "\t - #{description} "
        Cli.show_wait_spinner &block
        print "\b ✓\n"
    end