Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save aslakhellesoy/982680 to your computer and use it in GitHub Desktop.
Save aslakhellesoy/982680 to your computer and use it in GitHub Desktop.
This is a mechanize github message sender for the authors of all cucumber tmbundle forks
require 'rubygems'
require 'mechanize'
require 'net/http'
require 'json'
#get the tmbundle forkers
base_url = "http://github.com/api/v2/json/repos/show/cucumber/cucumber-tmbundle/network"
cuke_tmbundle_forkers = JSON.parse(Net::HTTP.get_response(URI.parse(base_url)).body).first[1].map{ |x| x["owner"] }
agent = Mechanize.new
# Get the github sign in page
page = agent.get('https://github.com/login')
# Fill out the login form
form = page.form_with(:action => '/session')
form.login = ARGV[0]
form.password = ARGV[1]
page = agent.submit(form)
cuke_tmbundle_forkers.each do |forker|
puts "messaging #{forker}"
page = agent.get("https://github.com/inbox/new/#{forker}")
#go to inbox, set subject and body and send!
form = page.form_with(:action => "/inbox")
form["message[subject]"] = "Cucumber TextMate plugin hackfest"
form["message[body]"] = <<-EOM
Hi!
As you may (or may not) have seen on the Cucumber google group the Cucumber TextMate plugin needs some love. There are dozens of forks and no merges to the canonical repo in the last year.
I'm organising an online hackfest on #cucumber (irc.freenode.net) some time during the next two weeks. If you want to help out (getting your changes merged in), fill in http://whenisgood.net/cucumber/tmbundle/hackfest so we can find some time slots that work for everyone.
For the full discussion, see: http://groups.google.com/group/cukes/browse_thread/thread/bf648fef563bbf99
Cheers!
Aslak and the Cucumber team
EOM
agent.submit(form)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment