test.rb
#!/usr/bin/ruby -Ku # require 'rubygems' gem 'twitter4r', '>=0.3.0' require 'twitter' require 'twitter/console' require 'time' require 'yaml' twitter = Twitter::Client.from_config( 'conf.yaml','test') # msg = gets.chomp # twitter.status(:post, msg) timeline = twitter.timeline_for(:friend, :id => 'nishimotz') do |status| puts "#{status.created_at.to_s} #{status.user.screen_name} #{status.text}" end
conf.yaml
test: login: nishimotz password: *****