Last active
August 29, 2015 14:01
-
-
Save ikr7/dc53c2fc0574c386d345 to your computer and use it in GitHub Desktop.
ツイート読み上げ
This file contains 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
var Command = require('../lib/command.js'), | |
exec = require('child_process').exec, | |
MeCab = require('mecab-async'), | |
mecab = new MeCab(); | |
var say = new Command(function(twit, status, CONFIG){ | |
if(status.retweeted_status) status = status.retweeted_status; | |
mecab.parse(status.text, function(err, result){ | |
if(!err){ | |
var kana = result.map(function(e){ | |
return e[8]; | |
}).join(''); | |
exec('say ' + status.user.screen_name, function(){ | |
exec('saykana -s 180 \"' + kana + '\"'); | |
}) | |
} | |
}); | |
}); | |
say.setTrigger(function(data, CONFIG){ | |
return 'text' in data; | |
}); | |
say.setPermission({ | |
'me': true, | |
'following': true, | |
'others': true | |
}); | |
module.exports = say; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment