Sha256: 2e565f8de041be68aac04410768d8a6721db7ada8072ce8c27f7e8727ea94392

Contents?: true

Size: 701 Bytes

Versions: 3

Compression:

Stored size: 701 Bytes

Contents

class Twexicon::CLI
  def call
    puts "Welcome to Twexicon."
    run = true

    while run
      username = Twexicon::Validator.new.run
      tweets = Twexicon::Scraper.new(username).refine_tweets
      if tweets.empty?
        puts "Unfortunately, @#{username} has never tweeted or has their tweets protected. Sorry about that."
      else
        Twexicon::Analyzer.new(username, tweets)
      end

      input = ""
      until input =~ /^[yn]$/
        puts "Would you like to look up tweets from another Twitter handle? [Y/N]"
        input = gets.strip.gsub(/\W/, "").downcase
      end
      input =~ /[n]/ ? run = false : run = true
    end

    puts "Thank you –– come again!"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twexicon-0.1.8 lib/twexicon/cli.rb
twexicon-0.1.7.1 lib/twexicon/cli.rb
twexicon-0.1.6 lib/twexicon/cli.rb