Skip to content

Instantly share code, notes, and snippets.

@croaky
Created March 30, 2009 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save croaky/87918 to your computer and use it in GitHub Desktop.
Save croaky/87918 to your computer and use it in GitHub Desktop.
Tweet from the command line with REST Client
# Create a ~/.twitter/credentials.yml file.
# Example:
# name: twittername
# password: password
require 'rubygems'
require 'rest_client'
path = File.join(File.join(ENV['HOME'], ".twitter"), "credentials.yml")
user = YAML::load_file(path)
RestClient.log = "stdout"
resource = RestClient::Resource.new("http://twitter.com/statuses/update.xml",
:user => user['name'],
:password => user['password'])
resource.post :status => ARGV[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment