inko 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/inko.rb +6 -5
- data/lib/inko/version.rb +1 -1
- metadata +1 -1
data/lib/inko.rb
CHANGED
@@ -4,6 +4,7 @@ require "inko/version"
|
|
4
4
|
require 'inko/config'
|
5
5
|
|
6
6
|
require 'user_stream'
|
7
|
+
require 'shellwords'
|
7
8
|
|
8
9
|
module Inko extend self
|
9
10
|
|
@@ -15,6 +16,8 @@ module Inko extend self
|
|
15
16
|
# _,!
|
16
17
|
# cf http://d.hatena.ne.jp/nacookan/20081220/1229745342
|
17
18
|
def pronunciationize status
|
19
|
+
status.user.screen_name = status.user.screen_name.gsub(/_/, ' ').gsub(/([a-zA-Z]+|[0-9]+)/){$1 + ' '}.gsub(/@/,'@. ')
|
20
|
+
status.text = Shellwords::escape status.text.split(/\n/).join(" ")
|
18
21
|
status
|
19
22
|
end
|
20
23
|
|
@@ -31,15 +34,13 @@ module Inko extend self
|
|
31
34
|
raise e
|
32
35
|
end
|
33
36
|
|
34
|
-
client
|
35
|
-
|
36
|
-
client.user do |status|
|
37
|
+
UserStream::client.user do |status|
|
37
38
|
unless filter? status
|
38
39
|
status = pronunciationize status
|
39
40
|
# puts "#{status.user.screen_name}: "
|
40
41
|
# puts status.text
|
41
|
-
`say -v #{Config::VoiceActor} #{status.user.screen_name
|
42
|
-
`say -v #{Config::VoiceActor} #{status.text
|
42
|
+
`say -v #{Config::VoiceActor} #{status.user.screen_name} さんのツイート}`
|
43
|
+
`say -v #{Config::VoiceActor} #{status.text}`
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
data/lib/inko/version.rb
CHANGED