Giter Club home page Giter Club logo

hubot-chatwork's Introduction

ChatWork × Hubot 連携スクリプト

事前準備

事前に、Hubot用のユーザをChatWorkに作成しておき、APIのアクセストークンを発行しておく。

申請方法は、公式ドキュメントを参考に。 http://developer.chatwork.com/ja/index.html

ローカルで動かす

前提条件

  • node.jsがインストール済みであること
  • Hubotがインストール済みであること

セットアップ

$ git clone [email protected]:tmknom/hubot-chatwork.git
$ cd hubot-chatwork
$ npm install

環境変数のセット

$ export HUBOT_CHATWORK_TOKEN="xxxxxxxx"
$ export HUBOT_CHATWORK_ROOMS="12345678"
$ export HUBOT_CHATWORK_API_RATE="600"

Hubotの起動

$ bin/hubot -a chatwork

動作確認

先ほど環境変数でセットした、ChatWorkのグループチャット上で、「hubot ping」と入力。

HubotユーザがChatWork上で「PONG」と応答すればOK。

Herokuへデプロイ

前提条件

  • Herokuのアカウントが作成済みであるとと
  • Heroku Toolbeltがインストール済みであること

Herokuへアプリケーションをpush

$ heroku login
$ heroku create
$ git push heroku master

HerokuへChatWork連携用の情報を登録

$ heroku config:add HUBOT_CHATWORK_TOKEN="xxxxxx"
$ heroku config:add HUBOT_CHATWORK_ROOMS="1234"
$ heroku config:add HUBOT_CHATWORK_API_RATE="600" 

Herokuのアイドリング防止設定

heroku config:set HUBOT_HEROKU_KEEPALIVE_URL=$(heroku apps:info -s | grep web_url | cut -d= -f2)

Herokuのタイムゾーン変更

$ heroku config:add TZ=Asia/Tokyo

動作確認

ローカルの時と同様。

hubot-chatwork's People

Contributors

tmknom avatar

Watchers

James Cloos avatar Ai MAKABI avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.