Skip to content

Instantly share code, notes, and snippets.

@vinbarnes
Created October 29, 2009 12:09
Show Gist options
  • Save vinbarnes/221389 to your computer and use it in GitHub Desktop.
Save vinbarnes/221389 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby -w
require 'yaml'
users = YAML::load(File.open(File.join(File.expand_path('~/'), '.twitrc'), 'r'))
user = users.find {|u| u[:name] == ARGV[0]}
if (not user.empty?)
post = ARGV[1..-1].join(' ')
bark = %[curl -u #{user[:name]}:'#{user[:password]}' -d status="#{post}" http://twitter.com/statuses/update.json]
result = %x[#{bark}]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment