Ybot - is a customizable bot which was inspired by GitHub's Hubot and written with Erlang programming language. You can create pligin for Ybot in one of following languages:
Here you can see simple Elixir module with some attributes (@repo, @author and etc...), and sending http 'GET' request to the Github commits API. We must get response like this:
Now we must get some fields from this response, like a commit's author, commit message and etc...:
Ybot has an own storage with REST API, thank you to @tajgur. You can find documentation for it - here. And also Ybot has notifications support, in other words you can set up Ybot that it will execute your plugin by timeout and send result to you. For example you can configure Ybot that it will send to you status of your system every hour and etc... We have memory API in Ybot and we can get last information about repository commits, check it, save last commit if it changed and will send update to the chat. Remeber that Ybot's plugin must write it's result to the STDOUT in the end of execution. Here is the full source code of this plugin:
Put this plugin to Ybot's notifications directory and set up it in configuration file:
Where:
- Python
- Ruby
- Shell
- Perl
- Erlang/OTP
- Elixir
- Scala
GET /repos/:owner/:repo/commitsLet's create Elixir module and send request to the Github API:
Here you can see simple Elixir module with some attributes (@repo, @author and etc...), and sending http 'GET' request to the Github commits API. We must get response like this:
Now we must get some fields from this response, like a commit's author, commit message and etc...:
Ybot has an own storage with REST API, thank you to @tajgur. You can find documentation for it - here. And also Ybot has notifications support, in other words you can set up Ybot that it will execute your plugin by timeout and send result to you. For example you can configure Ybot that it will send to you status of your system every hour and etc... We have memory API in Ybot and we can get last information about repository commits, check it, save last commit if it changed and will send update to the chat. Remeber that Ybot's plugin must write it's result to the STDOUT in the end of execution. Here is the full source code of this plugin:
Put this plugin to Ybot's notifications directory and set up it in configuration file:
Where:
- github_commits_notifications - plugin name
- [irc, twitter] - list of transports in which Ybot will send report
- 600 - timeout in seconds
- IRC
- XMPP
- Campfire
- HipChat
- Skype
- HTTP
- FlowDock
- SMTP
Comments