Skip to content

Instantly share code, notes, and snippets.

@itochan
Created January 29, 2011 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itochan/802237 to your computer and use it in GitHub Desktop.
Save itochan/802237 to your computer and use it in GitHub Desktop.
そのままバッククォートで囲ってるから対話式のものとかだめでそもそも出力されないという
#!/usr/bin/env ruby
# coding: utf-8
require "oauth"
require "rubytter"
CONSUMER_KEY = "kore"
CONSUMER_SECRET = "sore"
ACCESS_TOKEN = "are"
ACCESS_TOKEN_SECRET = "dore"
consumer = OAuth::Consumer.new(
CONSUMER_KEY,
CONSUMER_SECRET,
:site => "http://api.twitter.com"
)
token = OAuth::AccessToken.new(
consumer,
ACCESS_TOKEN,
ACCESS_TOKEN_SECRET
)
command = ARGV.join(" ")
starttime = Time.now.to_f
result = `#{command}`
time = Time.now.to_f - starttime
rubytter = OAuthRubytter.new(token)
rubytter.update "tweet.rb: #{command} 終わった #{time}秒かかった"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment