Created
May 20, 2011 07:02
-
-
Save corroded/982479 to your computer and use it in GitHub Desktop.
This is a mechanize github message sender for the authors of all cucumber tmbundle forks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
require 'net/http' | |
require 'json' | |
#get the tmbundle forkers | |
url = "http://github.com/api/v2/json/repos/show/cucumber/cucumber-tmbundle/network" | |
cuke_tmbundle_forkers = JSON.parse(Net::HTTP.get_response(URI.parse(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| | |
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]"] = "test for cucumber tmbundle network" | |
form["message[body]"] = "lorem ipsum text for you know foo bar" | |
agent.submit(form) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment