开源的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]
Available options:
-a, --adapter ADAPTER The Adapter to use
-c, --create PATH Create a deployable hubot
-d, --disable-httpd Disable the HTTP server
-h, --help Display the help information
-l, --alias ALIAS Enable replacing the robot's name with alias
-n, --name NAME The name of the robot in chat
-r, --require PATH Alternative scripts path
-t, --config-check Test hubot's config to make sure it won't fail at startup
-v, --version Displays the version of hubot installed[/quote]
-a 指定Adapter(默认是shell)
-d 关闭HTTP服务(默认是开启的)
-c deprecated 使用yeoman
采用默认的shell adapter
[quote]D:\hubotsample>bin\hubot[/quote]
指定adapter
[quote]D:\hubotsample>bin\hubot -a shell[/quote]
[quote]okbot> help
usage:
history
exit, \q - close shell and exit
help, \? - print this usage
clear, \c - clear the terminal screen[/quote]
[quote]okbot> okbot help
okbot> Shell: okbot adapter - Reply with the adapter
okbot animate me - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
okbot echo - Reply back with okbot help - Displays all of the help commands that Hubot knows about.
okbot help - Displays all help commands that match .
okbot image me - The Original. Queries Google Images for and returns a random top result.
okbot map me - Returns a map view of the area returned by `query`.
okbot mustache me - Adds a mustache to the specified URL or query result.
okbot ping - Reply with pong
okbot pug bomb N - get N pugs
okbot pug me - Receive a pug
okbot the rules - Make sure hubot still knows the rules.
okbot time - Reply with current time
okbot translate me - Searches for a translation for the and then prints that bad boy out.
okbot translate me from into - Translates from into . Both and are optional
ship it - Display a motivation squirrel
okbot ping
okbot> PONG
okbot echo 你好!
okbot> 你好!
okbot time
okbot> Server time is: Fri Sep 30 2016 11:05:24 GMT+0800 (中国 (标准时间))[/quote]
因为Hubot要解析脚本文件,提供help帮助,所以脚本文件开头的注释是规范的,
第一行必须是注释“# Description:”(其他的可以没有),否则会有警告:
[quote]hello.coffee is using deprecated documentation syntax[/quote]
Hubot同时也支持js,比如:
scripts/hello2.js
// Description: // This is a test2. // Commands: // okbot helo - Reply with world!
将package-name添加到external-scripts.json
[quote]"hubot-plusplus"[/quote]
[quote]okbot> ruby++
okbot> ruby has 1 point
okbot> java--
okbot> java has -1 points[/quote]
[color=blue][b](六)hubot-script实例[/b][/color]
[b]定时脚本[/b]
scripts/cron.coffee
cronJob = require('cron').CronJob
module.exports = (robot) -> send = (room, msg) -> response = new robot.Response(robot, {user : {id : -1, name : room}, text : "none", done : false}, []) response.send msg
new cronJob('0 * * * * *', () -> currentTime = new Date send '#your-channel-name', "current time is #{currentTime.getHours()}:#{currentTime.getMinutes()}." ).start()
[quote]D:\hubotsample>npm install cron --save
D:\hubotsample>bin\hubot -a shell[/quote]
spring JMS对于异步消息处理基本上只需配置下就能进行高效的处理。其核心就是消息侦听器容器,常用的类就是DefaultMessageListenerContainer。该容器可配置侦听器的并发数量,以及配合MessageListenerAdapter使用消息驱动POJO进行消息处理。且消息驱动POJO是放入TaskExecutor中进行处理,进一步提高性能,减少侦听器的阻塞。具体配置如下:
ZIP文件的解压缩实质上就是从输入流中读取数据。Java.util.zip包提供了类ZipInputStream来读取ZIP文件,下面的代码段创建了一个输入流来读取ZIP格式的文件;
ZipInputStream in = new ZipInputStream(new FileInputStream(zipFileName));
&n
Spring可以通过注解@Transactional来为业务逻辑层的方法(调用DAO完成持久化动作)添加事务能力,如下是@Transactional注解的定义:
/*
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version
使用nginx lua已经两三个月了,项目接开发完毕了,这几天准备上线并且跟高德地图对接。回顾下来lua在项目中占得必中还是比较大的,跟PHP的占比差不多持平了,因此在开发中遇到一些问题备忘一下 1:content_by_lua中代码容量有限制,一般不要写太多代码,正常编写代码一般在100行左右(具体容量没有细心测哈哈,在4kb左右),如果超出了则重启nginx的时候会报 too long pa
import java.util.Stack;
public class ReverseStackRecursive {
/**
* Q 66.颠倒栈。
* 题目:用递归颠倒一个栈。例如输入栈{1,2,3,4,5},1在栈顶。
* 颠倒之后的栈为{5,4,3,2,1},5处在栈顶。
*1. Pop the top element
*2. Revers
仅作笔记使用
public class VectorQueue {
private final Vector<VectorItem> queue;
private class VectorItem {
private final Object item;
private final int quantity;
public VectorI