Created
January 29, 2011 21:56
-
-
Save itochan/802237 to your computer and use it in GitHub Desktop.
そのままバッククォートで囲ってるから対話式のものとかだめでそもそも出力されないという
This file contains hidden or 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
#!/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