Skip to content

Instantly share code, notes, and snippets.

@ik11235
Created December 31, 2014 15:13
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 ik11235/528acbc9d8a2bcf73f3c to your computer and use it in GitHub Desktop.
Save ik11235/528acbc9d8a2bcf73f3c to your computer and use it in GitHub Desktop.
# 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