def attempt_import(&block)
tweet_file = File.join(ENV['HOME'], '.twitter')
if File.exists?(tweet_file)
say '.twitter file found, attempting import...'
config = YAML::load(File.read(tweet_file))
if !config['email'].blank? && !config['password'].blank?
Account.add(:username => config['email'], :password => config['password'])
say 'Account imported'
block.call if block_given?
true
else
say "Either your username or password were blank in your .twitter file so I could not import. Use 'twitter add' to add an account."
false
end
end
end