-
-
Save bogdanRada/ddfda90b420e894d8b80 to your computer and use it in GitHub Desktop.
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