{"id":148,"date":"2015-02-11T06:54:25","date_gmt":"2015-02-10T21:54:25","guid":{"rendered":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2015\/02\/11\/hubot-hipchat"},"modified":"2022-10-26T09:48:32","modified_gmt":"2022-10-26T00:48:32","slug":"hubot-hipchat","status":"publish","type":"post","link":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/blog\/2015\/02\/11\/hubot-hipchat\/","title":{"rendered":"\u4eca\u3055\u3089\u306a\u611f\u3058\u306f\u3059\u308b\u3051\u3069 Hubot \u3092\u5c0e\u5165\u3057\u3066\u307f\u305f"},"content":{"rendered":"
\u5f0a\u793e\u3067\u306f\u793e\u5185\u306e\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30eb\u3068\u3057\u3066\u3001HipChat \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002
\u4ed5\u69d8\u306e\u78ba\u8a8d\u3068\u304b\u696d\u52d9\u4e0a\u3067\u5fc5\u8981\u306a\u3053\u3068\u3084\u3069\u3046\u3067\u3082\u3044\u3044\u96d1\u8ac7\u306a\u3069\u3001\u983b\u7e41\u306b HipChat \u4e0a\u3067\u3084\u308a\u53d6\u308a\u304c\u3042\u308a\u3001Github \u3068\u304b Bitbucket \u3068\u304b PivotalTracker \u3068\u304b\u3044\u308d\u3044\u308d\u9023\u643a\u3092\u3057\u3066\u3044\u3066\u3001\u901a\u77e5\u304c\u98db\u3093\u3067\u6765\u305f\u308a\u3082\u3059\u308b\u306e\u3067\u3001\u975e\u5e38\u306b\u91cd\u8981\u306a\u30c4\u30fc\u30eb\u3068\u306a\u3063\u3066\u3044\u308b\u3002
\u305d\u306e HipChat \u304b\u3089\u30aa\u30da\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u51fa\u6765\u308b\u3068\u3044\u3044\u306a\u3041\u3001\u3068\u601d\u3063\u3066\u3044\u3066\u3001\u524d\u304b\u3089\u5c0e\u5165\u3057\u3066\u307f\u305f\u304b\u3063\u305f Hubot \u3092\u5c0e\u5165\u3057\u3066\u307f\u305f\u3002 <\/p>\n
![hubot](\/images\/hubot_hipchat\/hubot.jpg =300x300)
Hubot \u3068\u306f\u3001Github \u793e\u304c\u4f5c\u3063\u3066\u3044\u308b\u3001\u30c1\u30e3\u30c3\u30c8\u306e\u30dc\u30c3\u30c8\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3002\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u3067\u3001Node.js \u3068 CoffeeScript \u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u3002
Hubot \u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u30c1\u30e3\u30c3\u30c8\u30c4\u30fc\u30eb\u304b\u3089\u69d8\u3005\u306a\u30aa\u30da\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308b\u3002ChatOps \u3068\u3044\u3046\u3084\u3064\u3067\u3042\u308b\u3002
\u4f55\u3068\u306a\u304f\u97ff\u304d\u304c\u304b\u3063\u3053\u3044\u3044\u306d\u2026\u3002
\u4eca\u56de\u306f\u5c0e\u5165\u65b9\u6cd5\u306a\u3069\u3001\u7c21\u5358\u3067\u306f\u3042\u308b\u304c\u307e\u3068\u3081\u3066\u307f\u305f\u3002<\/p>\n
\u4eca\u56de\u306f\u3001nvm(node version manager)<\/a> \u3092\u5229\u7528\u3057\u3066\u3001Node.js \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3002 \u307e\u305f\u3001\u30c7\u30fc\u30bf\u306e\u6c38\u7d9a\u5316\u306b Redis \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3001Redis \u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n \u5404\u7a2e\u30b9\u30af\u30ea\u30d7\u30c8\u306a\u3069 CoffeeScript \u3067\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u3067\u3001CoffeeScript \u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u3002<\/p>\n HUBOT_HIPCHAT_JID\u3001HUBOT_HIPCHAT_PASSWORD\u3001HUBOT_HIPCHAT_ROOMS\u3001HUBOT_LOG_LEVEL \u306a\u3069\u306e\u74b0\u5883\u5909\u6570\u3092 HUBOT_HIPCHAT_JID \u306f\u3001\u4e0b\u8a18\u753b\u50cf\u306e\u3088\u3046\u306bXMPP\/Jabber account settings<\/a>\u306e Jabber ID \u3092\u3001HUBOT_HIPCHAT_ROOMS \u306b\u306f\u3001\u30eb\u30fc\u30e0 JID \u3092\u8a18\u8ff0\u3059\u308b\u3002 \u8d77\u52d5\u3057\u305f\u3089\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u306e\u3067( \u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067\u8d77\u52d5\u3059\u308b\u3002<\/p>\n \u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u8d77\u52d5\u3059\u308b\u306b\u306f\u3001 \u4f8b\u3048\u3070\u4e0b\u8a18\u306e\u3088\u3046\u306b\u3001 HipChat \u3067\u3001hubot \u3078\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30e1\u30f3\u30b7\u30e7\u30f3\u3092\u9001\u308b\u3068\u3001\u30d1\u30b0\u306e\u753b\u50cf\u3092\u30e9\u30f3\u30c0\u30e0\u3067\u8868\u793a\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n \u753b\u50cf\u691c\u7d22\u3092\u3057\u3066\u3001\u7d50\u679c\u3092\u30e9\u30f3\u30c0\u30e0\u3067\u8fd4\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n YouTub \u304b\u3089\u691c\u7d22\u3057\u305f\u7d50\u679c\u3092\u8fd4\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n <\/p>\n \u524d\u8ff0\u306e \u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3001\u81ea\u5206\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u3088\u3046\u304b\u3068\u601d\u3046\u3002 <\/p>\n \u3053\u3061\u3089\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u53c2\u8003\u306b\u3057\u305f\u3002 \u30b9\u30af\u30ea\u30d7\u30c8\u306e\u69cb\u9020\u3068\u3057\u3066\u306f\u4e0b\u8a18\u306e\u3068\u304a\u308a\u3002<\/p>\n Hubot \u306e\u30e1\u30bd\u30c3\u30c9\u3068\u3057\u3066\u3001 \u30ec\u30b9\u30dd\u30f3\u30b9\u3068\u3057\u3066\u306f\u3001\u4f55\u7a2e\u985e\u304b\u3042\u308b\u304c\u3001\u305d\u306e\u4e2d\u3067\u3082 \u8a66\u3057\u306b\u307e\u3063\u305f\u304f\u9700\u8981\u304c\u306a\u3044\u3068\u601d\u308f\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u305f\u3002<\/p>\n HipChat \u306e\u30eb\u30fc\u30e0\u5185\u3067\u3001 \u8a66\u3057\u3066\u307f\u305f\u3002 \u30e9\u30f3\u30c0\u30e0\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3057\u305f\u3044\u3068\u304d\u306b\u306f\u3001 janken \u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u898b\u3066\u3001\u30b0\u30fc\u3001\u30c1\u30e7\u30ad\u3001\u30d1\u30fc\u3092\u30e9\u30f3\u30c0\u30e0\u3067\u8fd4\u3057\u3066\u304f\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3002\u3058\u3083\u3093\u3051\u3093\u306e\u52dd\u3061\u8ca0\u3051\u306e\u5224\u5225\u307e\u3067\u306f\u5165\u308c\u3066\u306a\u3044\u3002 \u74b0\u5883\u5909\u6570\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\u3001 \u3082\u3063\u3068\u3061\u3087\u3063\u3068\u30de\u30b7\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u306a\u3044\u3068\u3001Hubot \u3092\u5c0e\u5165\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u3068\u304b\u5206\u304b\u308a\u3065\u3089\u3044\u306e\u3067\u3001 Hubot \u3092\u89e6\u3063\u3066\u307f\u3066\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u3082\u3044\u308d\u3044\u308d\u306a\u3053\u3068\u304c\u51fa\u6765\u308b\u304c\u3001\u72ec\u81ea\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3082\u66f8\u3044\u3066\u4f7f\u3048\u308b\u306e\u3067\u3001\u3046\u307e\u304f\u5229\u7528\u3067\u304d\u308c\u3070\u304b\u306a\u308a\u696d\u52d9\u306e\u52b9\u7387\u3082\u30a2\u30c3\u30d7\u3057\u305d\u3046\u306a\u5370\u8c61\u3092\u53d7\u3051\u305f\u3002 \u300c\u3046\u3061\u306f\u3053\u3093\u306a\u98a8\u306b\u4f7f\u3063\u3066\u3044\u308b\u300d\u300c\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u4fbf\u5229\u300d\u7b49\u306e\u60c5\u5831\u304c\u3042\u308c\u3070\u3001\u6559\u3048\u3066\u3044\u305f\u3060\u3051\u308b\u3068\u52a9\u304b\u308a\u307e\u3059\u3002 \u793e\u5185\u306e HipChat \u306b Hubot \u3092\u5c0e\u5165\u3057\u3066\u307f\u305f \u5f0a\u793e\u3067\u306f\u793e\u5185\u306e\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30eb\u3068\u3057\u3066\u3001HipChat \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u3002\u4ed5\u69d8\u306e\u78ba\u8a8d\u3068\u304b\u696d\u52d9\u4e0a\u3067\u5fc5\u8981\u306a\u3053\u3068\u3084\u3069\u3046\u3067\u3082\u3044\u3044\u96d1\u8ac7\u306a\u3069\u3001\u983b\u7e41\u306b HipChat \u4e0a\u3067\u3084\u308a\u53d6\u308a\u304c\u3042\u308a\u3001Github \u3068\u304b Bitbucket \u3068\u304b PivotalTracker \u3068\u304b\u3044\u308d\u3044\u308d\u9023\u643a\u3092\u3057\u3066\u3044\u3066\u3001\u901a\u77e5\u304c\u98db\u3093\u3067\u6765\u305f\u308a\u3082\u3059\u308b\u306e\u3067\u3001\u975e\u5e38\u306b\u91cd\u8981\u306a\u30c4\u30fc\u30eb\u3068\u306a\u3063\u3066\u3044\u308b\u3002 […]<\/p>\n","protected":false},"author":3,"featured_media":684,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[69],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/148"}],"collection":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":1,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":3339,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/posts\/148\/revisions\/3339"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/p-corporate-blog-cms.mmmcorp.co.jp\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306f\u3001\u4e0b\u8a18\u306e\u3068\u304a\u308a\u3002nvm \u3067 Node.js \u306e stable \u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n$ curl https:\/\/raw.githubusercontent.com\/creationix\/nvm\/v0.23.3\/install.sh | bash\n$ nvm install stable<\/code><\/pre>\n
Redis \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n
# EPEL \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u6709\u52b9\u306b\n$ sudo yum -y install redis --enablerepo=epel\n\n# Redis \u8d77\u52d5\n$ sudo service redis start\n\n# Redis \u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\n$ sudo chkconfig redis on<\/code><\/pre>\n
CoffeeScript \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n
$ npm install -g coffee-script<\/code><\/pre>\n
yo \u3068 generator-hubot \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n
$ npm install -g yo generator-hubot<\/code><\/pre>\n
yo hubot<\/code> \u3067\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u306e\u3072\u306a\u5f62\u3084\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u7b49\u3092\u4f5c\u6210\u3059\u308b<\/h5>\n
$ mkdir myhubot\n$ cd myhubot\n$ yo hubot<\/code><\/pre>\n
HipChat \u9023\u643a\u306b\u5fc5\u8981\u306a\u74b0\u5883\u5909\u6570\u3092\u8a18\u8ff0\u3059\u308b<\/h5>\n
bin\/hubot<\/code> \u306b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u8a18\u8ff0\u3059\u308b\u3002<\/p>\n
$ vi bin\/hubot<\/code><\/pre>\n
#!\/bin\/sh\n\nset -e\n\nnpm install\nexport PATH="node_modules\/.bin:node_modules\/hubot\/node_modules\/.bin:$PATH"\n\nexport HUBOT_HIPCHAT_JID="12345_6789@chat.hipchat.com"\nexport HUBOT_HIPCHAT_PASSWORD="HipChat\u306e\u30d1\u30b9\u30ef\u30fc\u30c9"\nexport HUBOT_HIPCHAT_ROOMS="12345_XXX\u30d7\u30ed\u30b8\u30a7\u30af\u30c8@conf.hipchat.com"\nexport HUBOT_LOG_LEVEL="debug"\n\nexec node_modules\/.bin\/hubot "$@"<\/code><\/pre>\n
<\/p>\nlibicu-devel \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n
no icu-config<\/code> \u3063\u3066\u30a8\u30e9\u30fc\u3060\u3063\u305f\u306f\u305a\u3002\u30e1\u30e2\u3059\u308b\u306e\u5fd8\u308c\u3066\u3057\u307e\u3063\u305f...)\u3001
libicu-devel<\/code> \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n
$ sudo yum install -y libicu-devel<\/code><\/pre>\n
HipChat \u7528\u306e\u30a2\u30c0\u30d7\u30bf\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h5>\n
$ npm install --save hubot-hipchat<\/code><\/pre>\n
\u8d77\u52d5<\/h5>\n
$ bin\/hubot -a hipchat<\/code><\/pre>\n
-a hipchat<\/code> \u306a\u3057\u3067\u8d77\u52d5\u3059\u308c\u3070OK\u3002\u52d5\u4f5c\u78ba\u8a8d\u306f\u3001
hubot ping<\/code> \u3068\u6253\u3064\u3002\u3059\u308b\u3068\u3001
PONG<\/code> \u3068\u8fd4\u3057\u3066\u304f\u308c\u308b\u3002<\/p>\n
$ bin\/hubot<\/code><\/pre>\n
Hubot> hubot ping\nPONG<\/code><\/pre>\n
\n\u30d5\u30a1\u30a4\u30eb\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u9020\u306b\u3064\u3044\u3066<\/h5>\n
yo hubot<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u3001\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u751f\u6210\u3055\u308c\u308b\u3002<\/p>\n
$ ls -l\n\u5408\u8a08 36\n-rw-rw-r-- 1 mmm mmm 35 2\u6708 2 10:16 Procfile\n-rw-rw-r-- 1 mmm mmm 5848 2\u6708 2 10:16 README.md\ndrwxrwxr-x 2 mmm mmm 4096 2\u6708 4 07:38 bin\n-rw-rw-r-- 1 mmm mmm 232 2\u6708 2 10:16 external-scripts.json\n-rw-rw-r-- 1 mmm mmm 25 2\u6708 3 08:24 hubot-scripts.json\ndrwxrwxr-x 18 mmm mmm 4096 2\u6708 2 10:31 node_modules\n-rw-rw-r-- 1 mmm mmm 641 2\u6708 2 10:31 package.json\ndrwxrwxr-x 2 mmm mmm 4096 2\u6708 3 08:34 scripts<\/code><\/pre>\n
scripts \u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/h6>\n
scripts<\/code>\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u3001\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u3068\u305d\u308c\u304c\u5b9f\u884c\u3067\u304d\u308b\u3002
example.coffee<\/code> \u304c\u3042\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u53c2\u8003\u306b\u72ec\u81ea\u306b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u304f\u3068\u3088\u3044\u3002 <\/p>\n
hubot-scripts.json<\/h6>\n
hubot-scripts.json<\/code> \u306b\u306f\u3001
node_modules\/hubot-scripts\/src\/scripts\/<\/code>\u914d\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u8a18\u8ff0\u3059\u308b\u3068\u3001\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u3061\u3089\u306e\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u53c2\u8003\u3002
https:\/\/github.com\/github\/hubot-scripts<\/a> <\/p>\ngithub-status.coffee<\/code>\u3092\u66f8\u304f\u3068\u3001github \u306e status \u304c\u78ba\u8a8d\u3067\u304d\u308b\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n
$ vi hubot-scripts.json<\/code><\/pre>\n
["github-status.coffee"]<\/code><\/pre>\n
external-scripts.json<\/h6>\n
external-scripts.json<\/code>\u3082\u57fa\u672c\u7684\u306b\u306f
hubot-scripts.json<\/code>\u3068\u540c\u3058\u3002\u3053\u3053\u306b\u306f\u3001
package.json<\/code>\u306b\u8a18\u8ff0\u3057\u305f\u3001npm \u3067\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u5916\u90e8\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u8a18\u8ff0\u3059\u308b\u3002\u305d\u3046\u3059\u308b\u3053\u3068\u3067\u3001npm \u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3082\u5229\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n
\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u4f7f\u3048\u305d\u3046\u306a\u3082\u306e<\/h3>\n
\u30d1\u30b0\u306e\u753b\u50cf\u3092\u8868\u793a\u3059\u308b<\/h5>\n
@bot pug me<\/code><\/pre>\n
\u4ed5\u4e8b\u306b\u75b2\u308c\u305f\u3068\u304d\u306b\u7652\u3055\u308c\u308b\u2026\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n\u753b\u50cf\u691c\u7d22\u3057\u3066\u30e9\u30f3\u30c0\u30e0\u3067\u8868\u793a\u3059\u308b<\/h5>\n
@bot img <\u691c\u7d22\u3059\u308b\u30ad\u30fc\u30ef\u30fc\u30c9><\/code><\/pre>\n
\u65e5\u672c\u8a9e\u3067\u306e\u691c\u7d22\u3082OK\u3002(\u30e9\u30fc\u30e1\u30f3\u98df\u3079\u305f\u304f\u306a\u3063\u3066\u304d\u305f...)<\/p>\nYouTube\u691c\u7d22<\/h5>\n
@bot youtube <\u66f2\u540d\u306a\u3069\u691c\u7d22\u30ef\u30fc\u30c9><\/code><\/pre>\n
\n
Github Status<\/h5>\n
hubot-scripts.json<\/code> \u306b\u3001
["github-status.coffee"]<\/code> \u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001Github \u306e Status \u3092\u78ba\u8a8d\u3067\u304d\u308b\u3002<\/p>\n
@bot github status<\/code><\/pre>\n
\u300c\u3042\u308c\uff1f\u3082\u3057\u304b\u3057\u3066\u3001Github \u843d\u3061\u3066\u308b\uff1f\u300d\u3063\u3066\u3044\u3046\u3068\u304d\u306b\u3001\u30b5\u30af\u30c3\u3068\u78ba\u8a8d\u3067\u304d\u3066\u4fbf\u5229\u3002<\/p>\n
\n\u30ab\u30b9\u30bf\u30e0\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u305f<\/h3>\n
\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/h5>\n
https:\/\/github.com\/github\/hubot\/blob\/master\/docs\/scripting.md<\/a> <\/p>\nmodule.exports = (robot) ->\n robot.hear \/badger\/i, (msg) ->\n # your code here\n\n robot.respond \/open the pod bay doors\/i, (msg) ->\n # your code here<\/code><\/pre>\n
hear<\/code> \u3068
respond<\/code><\/h5>\n
hear<\/code> \u3068
respond<\/code> \u304c\u3042\u308b\u3002
\n\u3069\u3061\u3089\u3082\u3001\u6b63\u898f\u8868\u73fe\u3067\u4e00\u81f4\u3057\u305f\u5834\u5408\u306b\u3044\u308d\u3044\u308d\u306a\u52d5\u4f5c\u3092\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002 <\/p>\nhear<\/h6>\n
hear<\/code> \u306f\u305d\u306e\u30eb\u30fc\u30e0\u5185\u306e\u767a\u8a00\u3092\u898b\u3066\u3001\u305d\u306e\u5358\u8a9e\u304c\u3042\u308c\u3070\u53cd\u5fdc\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3082\u306e\u3002
\u4e0a\u8a18\u306e\u4f8b\u3067\u884c\u304f\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u53cd\u5fdc\u3059\u308b\u3002 <\/p>\n\n
respond<\/h6>\n
respond<\/code> \u306f hubot \u306b\u5bfe\u3057\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3057\u305f\u5834\u5408\u306b\u3001\u53cd\u5fdc\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3082\u306e\u3002
\u4e0a\u8a18\u306e\u4f8b\u3067\u884c\u304f\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u53cd\u5fdc\u3059\u308b\u3002
(HAL<\/code> \u304c Hubot \u306e\u540d\u524d\u3002
\/<\/code> \u304c alias \u3068\u306a\u3063\u3066\u3044\u308b\u5834\u5408)<\/p>\n
\n
send<\/code> \u3068
reply<\/code><\/h5>\n
send<\/code> \u3068
reply<\/code> \u306e\u4f7f\u7528\u983b\u5ea6\u304c\u9ad8\u305d\u3046\u3002 <\/p>\n
send<\/h6>\n
send<\/code> \u306f\u30eb\u30fc\u30e0\u3067\u901a\u5e38\u306e\u767a\u8a00\u3092\u3059\u308b\u3082\u306e\u3002<\/p>\n
reply<\/h6>\n
reply<\/code> \u306f\u3001\u6b63\u898f\u8868\u73fe\u3067\u4e00\u81f4\u3059\u308b\u767a\u8a00\u3092\u3057\u305f\u4eba\u306b\u5bfe\u3057\u3066\u3001\u30e1\u30f3\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u3066\u767a\u8a00\u3092\u3059\u308b\u3082\u306e\u3002<\/p>\n
\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u308b<\/h5>\n
module.exports = (robot) ->\n robot.hear \/unk\/i, (msg) ->\n msg.reply "(poo)"<\/code><\/pre>\n
unk<\/code> \u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u3042\u3063\u305f\u3089\u3001\u767a\u8a00\u3057\u305f\u4eba\u306b\u5bfe\u3057\u3066 HipChat \u306e\u7d75\u6587\u5b57\u306e
(poo)<\/code> \u3067\u8fd4\u3057\u3066\u304f\u308c\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3002 <\/p>\n
\u3061\u3083\u3093\u3068\u52d5\u3044\u305f\uff01 \u256d( \uff65\u3142\uff65)\u0648 \u0311\u0311 \uff78\uff9e\uff6f ! <\/p>\nrandom<\/h6>\n
msg.random<\/code> \u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3082\u3042\u308b\u3002<\/p>\n
ans = ['\u30b0\u30fc', '\u30c1\u30e7\u30ad', '\u30d1\u30fc']\n\nmodule.exports = (robot) ->\n robot.respond \/janken\/i, (msg) ->\n msg.reply msg.random ans<\/code><\/pre>\n
\u307e\u3001\u8ca0\u3051\u305f\u3002\u3084\u308b\u306a\u3001Hubot\u3002\u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u82e5\u5e72\u6642\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u3001\u5f8c\u51fa\u3057\u3063\u307d\u304f\u898b\u3048\u308b\u3051\u3069(\u7b11)<\/p>\n\u74b0\u5883\u5909\u6570<\/h6>\n
process.env<\/code> \u3092\u4f7f\u3046\u3002prefix \u3068\u3057\u3066\u3001
HUBOT_<\/code> \u3092\u4f7f\u3046\u306e\u304c\u6163\u7fd2\u307f\u305f\u3044\u3060\u3002<\/p>\n
hello = process.env.HUBOT_HELLO\n\nmodule.exports = (robot) ->\n robot.hear \/hello\/i, (msg) ->\n msg.send "#{hello}, #{msg.message.user.name}"<\/code><\/pre>\n
hello<\/code> \u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u307f\u3066\u3001\u74b0\u5883\u5909\u6570
HUBOT_HELLO<\/code> \u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3092\u8fd4\u3057\u3066\u304f\u308c\u308b\u3002\u4eca\u56de\u306f\u3001\u74b0\u5883\u5909\u6570
HUBOT_HELLO<\/code> \u306b
Hey YO<\/code> \u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3002
<\/p>\n\u3082\u3046\u3061\u3087\u3063\u3068\u3060\u3051\u5b9f\u7528\u7684\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u305f<\/h5>\n
stock <\u8a3c\u5238\u30b3\u30fc\u30c9><\/code> \u3067 Hubot \u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b\u3068\u3001Yahoo!\u30d5\u30a1\u30a4\u30ca\u30f3\u30b9\u304b\u3089\u682a\u4fa1\u3092\u53d6\u5f97\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3044\u3066\u307f\u305f\u3002<\/p>\n
request = require 'request'\ncheerio = require 'cheerio'\n\nmodule.exports = (robot) ->\n robot.respond \/stock (.*)\/i, (msg) ->\n code = msg.match[1]\n options =\n url: 'http:\/\/stocks.finance.yahoo.co.jp\/stocks\/detail\/?code=' + code\n timeout: 2000\n\n request options, (err, res, body) ->\n $ = cheerio.load body\n company_name = $('th.symbol h1').text()\n current_price = $('td.stoksPrice').eq(1).text()\n msg.send "#{company_name}: #{current_price}\u5186"<\/code><\/pre>\n
\u3061\u3083\u3093\u3068\u53d6\u5f97\u3067\u304d\u305f\u3002\u30b5\u30af\u30c3\u3068\u682a\u4fa1\u304c\u78ba\u8a8d\u3067\u304d\u3066\u3044\u3044\u611f\u3058\u3002
\nrequest<\/a> \u3068 cheerio<\/a> \u3092\u4f7f\u3063\u3066\u307f\u305f\u3002(\u5b9f\u969b\u306b\u52d5\u304b\u3059\u5834\u5408\u306f\u3001request<\/code> \u3068
cheerio<\/code> \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5fc5\u8981\u306a\u306e\u3067\u6ce8\u610f)
\u4eca\u56de\u306f\u30b5\u30f3\u30d7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306a\u306e\u3067\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30eb\u3068\u304b\u5b9f\u88c5\u306f\u3057\u3066\u3044\u306a\u3044\u3002<\/p>\n
\n\u4eca\u5f8c\u306e\u53d6\u308a\u7d44\u307f\u3068\u3057\u3066<\/h3>\n
\u3044\u3061\u3044\u3061\u30d6\u30e9\u30a6\u30b6\u3067\u78ba\u8a8d\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u5b9a\u5f62\u4f5c\u696d\u3068\u304b\u3001HipChat \u4e0a\u3067\u30b5\u30c3\u3068\u3067\u304d\u308c\u3070\u826f\u3055\u305d\u3046\u3002
Hubot \u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u3001\u3082\u3063\u3068\u8abf\u3079\u3066\u696d\u52d9\u52b9\u7387\u5316\u3092\u9032\u3081\u305f\u3044\u3002
\u307e\u305f\u3001\u4ed6\u306e\u4f01\u696d\u304c\u3069\u306e\u3088\u3046\u306a\u4f7f\u3044\u65b9\u3092\u3057\u3066\u3044\u308b\u306e\u304b\u53c2\u8003\u306b\u3055\u305b\u3066\u3044\u305f\u3060\u3044\u3066\u3001\u826f\u3055\u305d\u3046\u306a\u4f7f\u3044\u65b9\u304c\u3042\u308c\u3070\u3069\u3093\u3069\u3093\u4f7f\u3063\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u308b\u3002 <\/p>\n
\u60c5\u5831\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059m(_ _)m<\/p>\n","protected":false},"excerpt":{"rendered":"