Created
March 30, 2009 22:22
-
-
Save croaky/87918 to your computer and use it in GitHub Desktop.
Tweet from the command line with REST Client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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