大家所熟知的智能聊天机器人,比如:微软小冰、Apple Siri、Google Now、IBM Watson等。微信自动回复、微信服务号里的客服Bot也都算是简单的实例。聊天机器人(Dialog System)主要实现方式有:基于人工模板(比如AIML)、基于搜索技术(比如ElasticSearch)、基于深度学习。从零实现这样的系统是很复杂的。
开源的ChatOps机器人:
1.[url=https://hubot.github.com/]Hubot[/url]:CoffeeScipt编写
2.[url=https://www.lita.io/]Lita[/url]:Ruby编写
3.[url=http://errbot.io/]Errbot[/url]:Python编写
[img]http://dl2.iteye.com/upload/attachment/0120/4886/05f0cb93-289d-3fd6-9b18-b664d7fc43c6.jpg[/img]
[url=https://www.pagerduty.com/blog/what-is-chatops/]So, What is ChatOps? And How do I Get Started?[/url]
[url=http://nordicapis.com/12-frameworks-to-build-chatops-bots/]12+ Frameworks to Build ChatOps Bots[/url]
[b]Hubot是由Github开发的开源聊天机器人,基于Node.js采用CoffeeScript编写。[/b]
Hubot [url=https://hubot.github.com/]https://hubot.github.com/[/url]
Hubot Scripts [url=https://github.com/hubot-scripts]https://github.com/hubot-scripts[/url]
Hubot Control [url=https://github.com/spajus/hubot-control]https://github.com/spajus/hubot-control[/url]
可以借助Hubot开发Chatbot来自动化的完成想要一切自动化任务,比如:
-运维自动化(编译部署代码、重启机器,监控服务器运行情况,自动修复Bug等)
-外部服务交互(管理Redmine、集成Jenkins、监视Zabbix等)
-定时获取天气预报
-随机订餐
-聊天机器人等等。
[img]http://dl2.iteye.com/upload/attachment/0120/4888/2193617c-9b79-3d28-91c2-1535de15f2c3.png[/img]
官方文档里有详细的使用说明,[url=https://hubot.github.com/docs/]https://hubot.github.com/docs/[/url],这里只做一个摘要。
Hubot Scripts里有大量的现成脚本可以用,也是自己编写脚本的最好sample。
[img]http://dl2.iteye.com/upload/attachment/0120/5867/d271c6db-3753-393b-ae7c-68408fcac6ce.png[/img]
[color=blue][b](一)安装[/b][/color]
运行Hubot需要以下软件支持:
[list]
[*]Node.js
[*]Redis 默认存贮数据
[*]CoffeeScript
[*]Yeoman
[*]generator-hubot 生成Hubot骨架工程
[/list]
[quote]C:\Users\rensanning>node -v
v0.12.8
C:\Users\rensanning>npm -v
2.14.9
C:\Users\rensanning>npm install -g yo generator-hubot
C:\Users\rensanning>npm list -g generator-hubot yo[/quote]
[color=blue][b](二)创建自己的bot[/b][/color]
[quote]C:\Users\rensanning>cd d:/
D:\>mkdir hubotsample
D:\>cd hubotsample
D:\hubotsample>yo hubot
? Owner RenSanNing <rensanning@gmail.com>
? Bot name okbot
? Description A sample hubot
? Bot adapter campfire[/quote]
默认提供了campfire和shell的adapter,其他的需要通过npm下载hubot-<AdapterName>。
也可以通过参数直接生成:
[quote]yo hubot --owner=rensanning@gmail.com --name=foobot --description="Foo Bot" --adapter=shell[/quote]
项目结构:
[list]
[*]bin/ 运行脚本
[*]node_modules 应用的包文件
[*]scripts 存放自定义脚本
[*]external-scripts.json 应用的外部脚本
[*]hubot-scripts.json *** 该文件已经无用,可以删除
[*]package.json 项目全局配置信息
[/list]
[color=blue][b](三)运行bot[/b][/color]
[quote]D:\hubotsample>bin\hubot -v
2.19.0
D:\hubotsample>bin\hubot -h
Usage hubot [o
开源的ChatOps机器人:
1.[url=https://hubot.github.com/]Hubot[/url]:CoffeeScipt编写
2.[url=https://www.lita.io/]Lita[/url]:Ruby编写
3.[url=http://errbot.io/]Errbot[/url]:Python编写
[img]http://dl2.iteye.com/upload/attachment/0120/4886/05f0cb93-289d-3fd6-9b18-b664d7fc43c6.jpg[/img]
[url=https://www.pagerduty.com/blog/what-is-chatops/]So, What is ChatOps? And How do I Get Started?[/url]
[url=http://nordicapis.com/12-frameworks-to-build-chatops-bots/]12+ Frameworks to Build ChatOps Bots[/url]
[b]Hubot是由Github开发的开源聊天机器人,基于Node.js采用CoffeeScript编写。[/b]
Hubot [url=https://hubot.github.com/]https://hubot.github.com/[/url]
Hubot Scripts [url=https://github.com/hubot-scripts]https://github.com/hubot-scripts[/url]
Hubot Control [url=https://github.com/spajus/hubot-control]https://github.com/spajus/hubot-control[/url]
可以借助Hubot开发Chatbot来自动化的完成想要一切自动化任务,比如:
-运维自动化(编译部署代码、重启机器,监控服务器运行情况,自动修复Bug等)
-外部服务交互(管理Redmine、集成Jenkins、监视Zabbix等)
-定时获取天气预报
-随机订餐
-聊天机器人等等。
[img]http://dl2.iteye.com/upload/attachment/0120/4888/2193617c-9b79-3d28-91c2-1535de15f2c3.png[/img]
官方文档里有详细的使用说明,[url=https://hubot.github.com/docs/]https://hubot.github.com/docs/[/url],这里只做一个摘要。
Hubot Scripts里有大量的现成脚本可以用,也是自己编写脚本的最好sample。
[img]http://dl2.iteye.com/upload/attachment/0120/5867/d271c6db-3753-393b-ae7c-68408fcac6ce.png[/img]
[color=blue][b](一)安装[/b][/color]
运行Hubot需要以下软件支持:
[list]
[*]Node.js
[*]Redis 默认存贮数据
[*]CoffeeScript
[*]Yeoman
[*]generator-hubot 生成Hubot骨架工程
[/list]
[quote]C:\Users\rensanning>node -v
v0.12.8
C:\Users\rensanning>npm -v
2.14.9
C:\Users\rensanning>npm install -g yo generator-hubot
C:\Users\rensanning>npm list -g generator-hubot yo[/quote]
[color=blue][b](二)创建自己的bot[/b][/color]
[quote]C:\Users\rensanning>cd d:/
D:\>mkdir hubotsample
D:\>cd hubotsample
D:\hubotsample>yo hubot
? Owner RenSanNing <rensanning@gmail.com>
? Bot name okbot
? Description A sample hubot
? Bot adapter campfire[/quote]
默认提供了campfire和shell的adapter,其他的需要通过npm下载hubot-<AdapterName>。
也可以通过参数直接生成:
[quote]yo hubot --owner=rensanning@gmail.com --name=foobot --description="Foo Bot" --adapter=shell[/quote]
项目结构:
[list]
[*]bin/ 运行脚本
[*]node_modules 应用的包文件
[*]scripts 存放自定义脚本
[*]external-scripts.json 应用的外部脚本
[*]hubot-scripts.json *** 该文件已经无用,可以删除
[*]package.json 项目全局配置信息
[/list]
[color=blue][b](三)运行bot[/b][/color]
[quote]D:\hubotsample>bin\hubot -v
2.19.0
D:\hubotsample>bin\hubot -h
Usage hubot [o