WWW::GitHub::PostReceiveHook - A simple means of receiving GitHub's web hooks
Create the listener:
use WWW::GitHub::PostReceiveHook; WWW::GitHub::PostReceiveHook->new( routes => { '/myProject' => sub { my $payload = shift; }, '/myOtherProject' => sub { run3 \@cmd ... } } )->run_if_script;
Save it. Toss it in /cgi-bin or mount it as a psgi app. Add http://your.host/myProject to github.com/myname/myproject/admin/hooks.
WWW::GitHub::PostReceiveHook is a CGI / PSGI wrapper for GitHub that tries to be simple like a local git hook.
Argument: routes => HashRef[CodeRef]
Sets up Web::Simple to listen on each route. If a GitHub payload is POST'd to a given path, it will be deserialized and passed to that paths callback.
Sometimes you just want to kick off an email, or run a small script when someone commits to github. In situations like these, busting out a full-sized framework like Dancer/Catalyst is almost always overkill to listen for GitHub's postreceive hooks. Use this module and you can be off to the races after a quick copy-paste.
Yes! But most people searching cpan for 'github postreceive' probably haven't heard of Web::Simple.
http://help.github.com/post-receive-hooks/ for details on what gets POST'd by GitHub
WWW::GitHub::PostReceiveHook uses Web::Simple to do the heaving lifting, so that would be a good start.
Dancer, Catalyst, CGI
Matt Phillips <mattp@cpan.org>
This software is copyright (c) 2011 by Matt Phillips.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install WWW::GitHub::PostReceiveHook, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::GitHub::PostReceiveHook
CPAN shell
perl -MCPAN -e shell install WWW::GitHub::PostReceiveHook
For more information on module installation, please visit the detailed CPAN module installation guide.