Skip to content

Instantly share code, notes, and snippets.

@igrep
Created June 29, 2011 07:00
Show Gist options
  • Save igrep/1053293 to your computer and use it in GitHub Desktop.
Save igrep/1053293 to your computer and use it in GitHub Desktop.
Very simple twitter client for CLI (just tweet!)
alias tweet='cat ~/your-token.yaml | tw-post.rb'
ckey: ****
csecret: ****
atoken: ****
atoken_secret: ****
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
$VERBOSE = true
=begin
Tweet the argument
=end
require 'yaml'
require 'rubygems'
require 'twitter'
Twitter.configure {|cfg|
tokens = YAML.load $stdin
cfg.consumer_key = tokens['ckey']
cfg.consumer_secret = tokens['csecret']
cfg.oauth_token = tokens['atoken']
cfg.oauth_token_secret = tokens['atoken_secret']
}
Twitter.update ARGV.join(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment