2013-08-19 46 views
5

我最近得到了irc的hubot设置,并且工作正常。我正在尝试添加this script.Hubot的github-pull-request-notifier.coffee

但是,我并不完全了解设置说明。读取的设置说明

curl -H "Authorization: token <your api token>" \ 
-d '{"name":"web","active":true,"events":["pull_request"],"config":{"url":"<this script url>","content_type":"json"}}' \ 
https://api.github.com/repos/<your user>/<your repo>/hooks 

我不明白"url":"<this script url>"指的是什么。有人知道吗?

我正在部署到heroku,如果有帮助。

回答

1

Add <HUBOT_URL>:<PORT>/hubot/gh-pull-requests?room=<room>[&type=<type>] url hook via API

这是URL

4

到接收器添加更多解释@MikeKusold的回答

curl命令是创建github hook,因此它被设置挂机通知。

"config": { 
    "url": "http://example.com/webhook", 
    "content_type": "json" 
} 

挂钩是hubot插件,这样的URL路径在that script定义,见行

robot.router.post "/hubot/gh-pull-requests", (req, res) -> 

下面的脚本两行告诉你什么是路径后,它的参数room & type

user.room = query.room if query.room 
user.type = query.type if query.type 

Hubot本身定义的端口号,它的路由路径,因为它要求的插件,在robot.coffee检查这一部分,德故障端口是8080

因此,URL是像下面

http://<your hubot sever>:8080/hubot/gh-pull-requests/?room=<room>&type=<type> 

其实你可以使用curl命令直接先测试其对hubot。