kimotter 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +10 -3
- data/bin/kimotter +13 -4
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -4,11 +4,18 @@ This module is relly useful twitter client
|
|
4
4
|
-d, --debug Debug Mode
|
5
5
|
-f, --force Force execute, ignore api limit
|
6
6
|
|
7
|
+
== Install
|
8
|
+
Require: Ruby 1.9, nokogiri, mechanize
|
9
|
+
gem install kimotter
|
10
|
+
|
7
11
|
== Example
|
8
12
|
> kimotter "EventSource知らんかった、普通に便利そう"
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
嘘偽りなく自分がキモトであると誓います[y/N] y
|
14
|
+
hi kimoto. try to tweet your cool message
|
15
|
+
done!
|
16
|
+
|
17
|
+
== Donate
|
18
|
+
Hey guys, Please give me your money. thank you
|
12
19
|
|
13
20
|
== Copyright
|
14
21
|
Copyright (c) 2012 kimoto. See LICENSE for details.
|
data/bin/kimotter
CHANGED
@@ -3,10 +3,11 @@
|
|
3
3
|
require 'kimotter'
|
4
4
|
require 'logger'
|
5
5
|
require 'optparse'
|
6
|
+
require 'tempfile'
|
6
7
|
|
7
8
|
options = {}
|
8
9
|
parser = OptionParser.new{ |opts|
|
9
|
-
opts.banner = "Usage: #{File.basename($0)} [options] tweet_message"
|
10
|
+
opts.banner = "Usage: #{File.basename($0)} [options] [tweet_message]"
|
10
11
|
opts.on("-d", "--debug", "Debug Mode"){ |v|
|
11
12
|
options[:debug_mode] = true
|
12
13
|
}
|
@@ -16,11 +17,19 @@ parser = OptionParser.new{ |opts|
|
|
16
17
|
}
|
17
18
|
parser.parse!
|
18
19
|
|
19
|
-
## validate commandline arguments
|
20
20
|
message = ARGV.shift
|
21
21
|
unless message
|
22
|
-
|
23
|
-
|
22
|
+
file = Tempfile.new('foo')
|
23
|
+
file.close
|
24
|
+
|
25
|
+
unless system(ENV['EDITOR'], file.path)
|
26
|
+
raise "system command aborted"
|
27
|
+
end
|
28
|
+
message = File.read(file.path).chomp.gsub(/\n/, " ")
|
29
|
+
end
|
30
|
+
|
31
|
+
if message.empty?
|
32
|
+
raise "please input message"
|
24
33
|
end
|
25
34
|
|
26
35
|
logger = options[:debug_mode] ? Logger.new(STDERR) : Logger.new(nil)
|