2013-08-19 44 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。