Hubot 用js编程的机器人
今天看见 36氪 在twitter上说github的hubot开源了 ( http://www.36kr.com/tag/hubot ), 之前完全没听说过它. 看着是跑在node上的, 手就痒痒, 大概折腾了一下:
一句话概括就是:用指令将任务自动化. 这种东西firefox之前也搞过, 叫ubiquity 可惜已经不维护了, 还是蛮好用的一个插件.
把hubot的安装流程记录一下:
一, 安装nodejs和npm :
http://joyeur.com/2010/12/10/installing-node-and-npm/
二, 安装redis数据库
$ wget http://redis.googlecode.com/files/redis-2.4.1.tar.gz
$ tar xzf redis-2.4.1.tar.gz
$ cd redis-2.4.1
$ make
启动服务: $ src/redis-server
ps: 如果要redis开机启动 ( 可选 )
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/redis/2.2.12/io.redis.redis-server.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist
三, 安装hubot
1. 下载: https://github.com/github/hubot
2. 解压后进入hubot目录, 运行 npm install , 安装依赖.
四, 运行hubot
在hubot目录直接执行: bin/hubot 就可以了. 这时候你可以执行一下默认的hubot命令, 比如:
Hubot: Time
hubot目录下的hubot-scripts.json列出了加载的script, 按需修改.
![]() |
测试 hubot |
一句话概括就是:用指令将任务自动化. 这种东西firefox之前也搞过, 叫ubiquity 可惜已经不维护了, 还是蛮好用的一个插件.
![]() |
ubiquity |
把hubot的安装流程记录一下:
一, 安装nodejs和npm :
http://joyeur.com/2010/12/10/installing-node-and-npm/
二, 安装redis数据库
$ wget http://redis.googlecode.com/files/redis-2.4.1.tar.gz
$ tar xzf redis-2.4.1.tar.gz
$ cd redis-2.4.1
$ make
启动服务: $ src/redis-server
ps: 如果要redis开机启动 ( 可选 )
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/redis/2.2.12/io.redis.redis-server.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/io.redis.redis-server.plist
三, 安装hubot
1. 下载: https://github.com/github/hubot
2. 解压后进入hubot目录, 运行 npm install , 安装依赖.
四, 运行hubot
在hubot目录直接执行: bin/hubot 就可以了. 这时候你可以执行一下默认的hubot命令, 比如:
Hubot: Time
hubot目录下的hubot-scripts.json列出了加载的script, 按需修改.