From 0152063d56a65af186c9aad9679c0ad6b709c280 Mon Sep 17 00:00:00 2001 From: Kosuke Otake Date: Fri, 20 May 2016 19:09:37 +0900 Subject: [PATCH 1/2] =?UTF-8?q?575=E6=A9=9F=E8=83=BD=E3=81=AE=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 発言が575だった場合にadd-reactionで指摘してくれる。 --- .gitignore | 4 +- README.md | 11 ++-- assets/goshichigo.png | Bin 0 -> 18942 bytes package.json | 3 +- scripts/575.js | 101 +++++++++++++++++++++++++++++++++++ scripts/data/meshi_shop.json | 21 -------- 6 files changed, 113 insertions(+), 27 deletions(-) create mode 100644 assets/goshichigo.png create mode 100644 scripts/575.js delete mode 100644 scripts/data/meshi_shop.json diff --git a/.gitignore b/.gitignore index b2e3908..2f1e873 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ node_modules .DS_Store* .hubot_history -test.json \ No newline at end of file +test.json + +scripts/gj.coffee \ No newline at end of file diff --git a/README.md b/README.md index d2b2608..8fb8f87 100644 --- a/README.md +++ b/README.md @@ -12,19 +12,22 @@ gochiusa-bot is "Is the order a rabbit?" BOT. ## Feature * ごちうさというフレーズに反応してアニメ画像をランダムで吐きます. - ![ごちうさというフレーズに反応する](./assets/gochiusa.png) + ![ごちうさというフレーズに反応する](./assets/gochiusa.png) * chino / @chino でチノちゃんがランダムでつぶやきます. - ![chinoとつぶやく](./assets/chino.png) + ![chinoとつぶやく](./assets/chino.png) * `$`で囲まれた部分をLaTeXと認識して数式を画像化したものを返します. - ![LaTeX画像化](./assets/latex.png) + ![LaTeX画像化](./assets/latex.png) * 麻雀点数計算機能 * `3翻30符`とかで点数を返します. (Thanks to [@dorapon2000](https://github.com/dorapon2000)) - ![点数表示](./assets/mahjong-calc.png) + ![点数表示](./assets/mahjong-calc.png) * 麻雀役出力機能 (Thanks to [@index30](https://github.com/index30), [@sga0221](https://github.com/sga0221), [@ksepynoin](https://github.com/ksepynoin)) ![麻雀役出力機能](./assets/mahjong.png) * ごちうさ言語の利用 (詳細は`glang help`を参考のこと) * マジカルシルクハットゲーム機能 * 遊戯王の「マジカルシルクハット」を元にしたゲーム機能です.マジカルシルクハットに隠れた「ブラック・マジシャン」を当てれば勝ち. +* 575通知機能 + * 発言した文章が575だった場合にadd-reactionしてくれる機能 + ![575の文章にadd-reactionする](./assets/goshichigo.png) ## How to contribute diff --git a/assets/goshichigo.png b/assets/goshichigo.png new file mode 100644 index 0000000000000000000000000000000000000000..e771297faa0c0d5f1a3fb05fcee33b43fb4d81a7 GIT binary patch literal 18942 zcmZU)18`jnlx@UUk z^i0oh&V9qmjl ztW5v__2488C}p(q=BmqV{_l=cLb51HnW33Zq9)%Rlc`Gy2*i=$Nd$yJ;&w#9Ve-j| z!eEJV^Ye+q!pJEj@=0D~W<3AGoz>`BxlCs(9VuUx>!|3MK?3k(9o^mOC!qPo&6R_) z7{ZVLoQe*{fI(k_n&v{1j3kcO^WfmXUF(haL!U+^hcceoe7N=eRZs2oCZYiFvywmF zMi&Ons%rOXYPCs^-h)T=cd42;&W6M6FWs~DHh z-wK%;KAZSaAKzisz)X6u4h3j%Q;nrn$T z42dxwLaRXYrGGTnstKoVs=nDr$`$5)*qvV)S=KEc?#}2}Y(F>J`NdI0%%(x=ML)UO zZ|%dl4TH0575K zK@^+F=-hW0Q7jMD+6gyy+25EcL*{ct&^<9~fRqg$QXSx}4+tZ`?&{?K4h;?h)=<@O z+%kzx%n$jk7wH+0Ml*f|eH4{0e{YNQr%w#+#czbqp)g7lA31PM?XNo96=Sbk0jnu7 z5p<`B19S*ZLDX!odaj$!z2ac0;eyZbH!L4Mbh9v~-n5-a`*>e>dHJQjV{{PE&&@|S zl1Ca>=r`=Q?_AN|kQ1|-_>I$N@Irs@Ctx~P%}vhUF8%hyd<|s5ll5_Q(z=={3oH6S+cu3?LZObIoKQ8#vE&Q{*lAGDdz5{JE-oUp}h3do#m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DDQ>jAe|B+~HUXkJmPvASB?HI+mZrpRxPk_x)k57>rYpzBCX>{MqqJe*_Xek!OexVe++rs|(pr$|eZNB+PpM2Hd@-j9qfN>K^~h^{FO) zb*^E*rROtV!NMJyGt7k-|92x}GC!aP>sYA+e0A{@S7;ic1t)nlC=;EBFIy9AOZqBr z2K)HrH~HVJUA7jDDe)n&v+8_FyZTGIz$K+0 z-D>pSr-PRB&e0#V7Zw+zrVEd&ax%P{9gp2w8HIhPuX3(?kFfl zE35Mk8Omh@6kFwSnp4zAPq9r?1;1Q9c=!txaZJxj7MU4&GfDG`YC)St+%Oq%iws!N zr1w4Xk`W`>FattIY&20G=OAZnOP4z8MJzXEAO%LD&o*KJCD#~jN3rFJ=)4m%BGKzK zrK75+RsCG>F@JWMfX)Yja`}a~T;m$MyX$ChlhWwWw4&iy1fI zyIWV{W)%F7y>R~`C!yYb_#EHS=@u6jP~GaZi^1dH_KWHnsN7TG8w!OD90Y#Pz@~Hc z;~ItaomvD?Rs^2PT2T_tlxZLkK1*f6A8wYk= 0.8.x", diff --git a/scripts/575.js b/scripts/575.js new file mode 100644 index 0000000..f862279 --- /dev/null +++ b/scripts/575.js @@ -0,0 +1,101 @@ +// Description: +// 文章が575の場合、教えてくれます。 +// +// Commands: +// hubot > 任意の575の文字列 +// hubot > add-reaction :goshichigo: +// + + +(function(){ + var url = "https://labs.goo.ne.jp/api/morph"; + var app_ID = process.env.GOO_APP_ID; + if (!app_ID){ + console.error("error: Set your GOO_APP_ID env variables."); + } + module.exports=function(robot){ + //入力された文章の取得 + return robot.hear(/.*/i,function(msg){ + //APIに渡すためのデータ + var data; + data = JSON.stringify({ + "app_id" : app_ID, + "sentence" : msg.match[0] + }); + return robot.http(url).header("Content-type","application/json").post(data)(function(err, res, body){ + var result = JSON.parse(body); + var sentence = result.word_list; + if(is575(sentence)) + return addReactions(msg,"goshichigo"); + + }); + }); + }; +}).call(this); + +//575か判定するメソッド +function is575(sentence){ + var count = [0,0,0]; + var count_lim = [5,7,5]; + var now_watch = 0; + for(i in sentence){ //行 + for(j in sentence[i]){ //列 + var word = sentence[i][j]; + if(word[2] == "$") //読めない文字は無視 + continue; + + //575達成後に読める文字が存在してしまう場合 + if(now_watch > 2) + return false; + + var is_joshi = (word[1].indexOf("助") != -1); //助詞の判定 + var is_hanteishi = (word[1].indexOf("判") != -1); //判定詞の判定 + + //575の最初が助詞、判定詞になってしまう場合、falseを返す + if((is_joshi || is_hanteishi) && count[now_watch] == 0) + return false; + + var wordReading = word[2].replace(/ャ|ュ|ョ|ァ|ィ|ゥ|ェ|ォ/g, ""); //小さい文字の削除 + count[now_watch] += wordReading.length; + + //文字数の判定 + if(count[now_watch] > count_lim[now_watch]){ + return false; + }else if(count[now_watch] == count_lim[now_watch]){ + now_watch++; + } + } + } + if(now_watch == 3) + return true; + else + return false; +} + + + +/* +add-reactionするメソッド +参考記事: +HubotでSlackのEmoji Reactionを付ける +http://qiita.com/hiconyan/items/f2c37a10ac2c581693ce +*/ +var request = require('request'); + +var addReactions = function(msg, name){ + var options; + options = { + url: 'https://slack.com/api/reactions.add', + qs: { + 'token': process.env.HUBOT_SLACK_TOKEN, + 'name': name, + 'channel': msg.message.rawMessage.channel, + 'timestamp': msg.message.rawMessage.ts + } + }; + return request.post(options, function(err, res, body) { + if ((err != null) || res.statusCode !== 200) { + return robot.logger.error("Failed to add emoji reaction " + (JSON.stringify(err))); + } + }); +}; diff --git a/scripts/data/meshi_shop.json b/scripts/data/meshi_shop.json deleted file mode 100644 index c0963e6..0000000 --- a/scripts/data/meshi_shop.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - ":ka::tsu::dai:", - "笑飯店", - ":gin:の:buta:", - ":uo::hachi:", - "百香亭", - "油虎", - "スタ丼", - ":tori::dori:", - "豚八", - "清六家", - "七福軒", - "NISHOKU", - "名店街", - "三食", - "三水", - "はりけんラーメン", - "千香華味", - "くい亭", - "シェーキーズ" -] From 9f82a5ab478fd4a478c714a6254684a47b9774c3 Mon Sep 17 00:00:00 2001 From: Kosuke Otake Date: Fri, 20 May 2016 19:10:35 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E9=A3=AF=E5=B1=8B=E3=81=AE=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add ことらんち --- scripts/data/meshi_shop.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 scripts/data/meshi_shop.json diff --git a/scripts/data/meshi_shop.json b/scripts/data/meshi_shop.json new file mode 100644 index 0000000..1bf2e7a --- /dev/null +++ b/scripts/data/meshi_shop.json @@ -0,0 +1,22 @@ +[ + ":ka::tsu::dai:", + "笑飯店", + ":gin:の:buta:", + ":uo::hachi:", + "百香亭", + "油虎", + "スタ丼", + ":tori::dori:", + "豚八", + "清六家", + "七福軒", + "NISHOKU", + "名店街", + "三食", + "三水", + "はりけんラーメン", + "千香華味", + "くい亭", + "シェーキーズ", + "小寅" +]