PreshBlog

Bot::BasicBot::Pluggable::Module::GitHub

by on May.10, 2011, under Perl, Programming

We have an IRC bot in the #dancer IRC channel powered by Bot::BasicBot::Pluggable, and I recently wrote some new features as a distribution of modules which I plan to release to CPAN soon.

Until then, you can see the code in the Bot::BasicBot::Pluggable::Module::GitHub repository on GitHub.

There are two modules so far:

EasyLinks

Bot::BasicBot::Pluggable::Module::GitHub::EasyLinks recognises certain elements within discussions on IRC and provides responses containing titles/URLs to see the corresponding entity, for instance:


<someuser> I'm just working on Issue 42 now
<bot> Issue 42 (Issue Title - Issues - sukria/Dancer - GitHub) - https://github.com/user/project/issues/42

<someuser> I've just submitted PR 517, anyone want to merge it?
<bot> Pull request 517 (Pull request title - Pull Request - GitHub) - https://github.com/user/project/pull/517

<someuser> What do you think of commit 0d2752 then?
<bot> Commit 0d2752 (Commit message summary here) - https://github.com/user/project/commit/0d2752...

PullRequests

Responds to a !pr command, reporting the number of open pull requests, either for whatever project is specified as the default for that channel, or a specific project can be named. For instance:


<someuser> !pr user/project
<bot> Open pull requests for user/project : 5 pull requests open (usera:3, userb:2)

I plan to add more features before releasing the first version to CPAN; in particular, I’d like to add commit hook support, so the module could spawn a trivial webserver to listen for hook triggers from GitHub, and announce commits.

As always, contributions would be welcomed.


Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!