Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created October 3, 2012 12:42
Show Gist options
  • Save cowboy/3826724 to your computer and use it in GitHub Desktop.
Save cowboy/3826724 to your computer and use it in GitHub Desktop.
grunt: Initialize GitHub IRC hooks
// Modify as-needed.
$.each({
server: 'irc.freenode.net',
port: '6667',
room: '#grunt',
nick: 'gruntly',
message_without_join: true,
}, function(id, val) {
var elem = $('#irc_' + id);
if (typeof val === 'boolean') {
elem.prop('checked', val);
} else {
elem.val(val);
}
});
$('#irc\\[active\\]').prop('checked', true);
$('#irc_server').closest('form').submit();

First, fork this gist.

From your organization's homepage (eg. https://github.com/gruntjs), open every repo's hooks admin page by running this jQuery snippet in the console, and pasting the logged output into a bash shell. It'll open a tab or two (or 27).

console.log('for i in ' + $('.public.source h3 a').map(function(){
  return this.href + '/admin/hooks';
}).get().join(' ') + '; do open $i; done');

One each page, run this bookmarklet. After the form gets submitted, you should see a message in blue at the top of the page confirming that everything worked.

javascript:$.getScript('https://raw.github.com/gist/YOUR_GIST_ID/init-gh-irc-hooks.js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment