LoginSignup
8
8

More than 5 years have passed since last update.

Hubotを使ってSlackからalc(英辞郎)の結果を取得する

Posted at

はじめに

普段からalcさんにお世話になっているのですが、ブラウザを開くのが面倒なので大体開いているSlackから取得できるようにHubot Scriptを作りました。

現状、英単語の結果しか返ってきません。

実行例

キャプチャ.PNG

alc hello or hubot alc me hello と命令すれば反応してくれます。

インストール方法

npmに公開済みなので、npmからインストールしてください。

GitHubにも公開済みなので、そちらから直で hubot/scripts 配下に入れても構いませんが、下記にある依存モジュールを忘れずに。

hubot/package.json

hubotpackage.json に下記を追加する。

"hubot-alc": "0.0.1",
"htmlparser": "1.7.6",
"soupselect": "0.2.0",

hubot-alc は今回作成したscriptです。

alcのhtmlをパースしているので依存モジュールに htmlparsersoupselect が存在しています。忘れずに。

hubot/external-scripts.json

"hubot-alc"

を追加して、使用可能にします。

おわりに

作ったはいいものの、コマンド打つくらいならブラウザで検索する気がする…

1時間くらいで作ったものなので、改良などのプルリクエストお待ちしています。 https://github.com/kaneshin/hubot-alc

8
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
8