Skip to content

Instantly share code, notes, and snippets.

@haraldmartin
Forked from croaky/twitter.rb
Created April 5, 2009 17:21
Show Gist options
  • Save haraldmartin/90486 to your computer and use it in GitHub Desktop.
Save haraldmartin/90486 to your computer and use it in GitHub Desktop.
# 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