Skip to content

Instantly share code, notes, and snippets.

@ik11235
Created December 31, 2014 15:13
Embed
What would you like to do?
# coding: utf-8
require 'twitter'
require 'optparse'
require './token'
def cmdline
args = {}
OptionParser.new do |parser|
parser.on('-m string', '--message string', '投稿文を指定') {|v| args[:mes] = v}
parser.parse!(ARGV)
end
args
end
client = Twitter::REST::Client.new do |config|
config.consumer_key = $consumer_key
config.consumer_secret = $consumer_secret
config.access_token = $access_token
config.access_token_secret = $access_token_secret
end
args = cmdline
client.update(args[:mes])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment