Skip to content

Instantly share code, notes, and snippets.

@joshnesbitt
Last active May 16, 2016 10:28
Show Gist options
  • Save joshnesbitt/17578ee8c4dcf7a769b78f6e58a46433 to your computer and use it in GitHub Desktop.
Save joshnesbitt/17578ee8c4dcf7a769b78f6e58a46433 to your computer and use it in GitHub Desktop.
A simple script to get you on the Mondo beta.

Mondo Referral Bump

Thanks to @cbarratt for writing this. Tested on Ruby 2.2.2.

Installation

Install the dependencies:

gem install capybara ffaker poltergeist selenium-webdriver chromedriver-helper

Replace SIGNUP_CODE with the UTM term in your referal link.

Usage

ruby script.rb
require 'rubygems'
require 'capybara'
require 'capybara/dsl'
require 'capybara/poltergeist'
require 'ffaker'
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app, browser: :chrome, args: ['--incognito'])
end
Capybara.run_server = false
Capybara.current_driver = :selenium
Capybara.javascript_driver = :selenium
Capybara.app_host = 'https://getmondo.co.uk'
SIGNUP_CODE = 'user_000097l0yHwjgH229Fpr1t'
SIGNUP_REFERRALS = 2
module Mondo
class Signup
include Capybara::DSL
def referral_bump
visit("/?utm_source=user_referral&utm_medium=referral&utm_term=#{SIGNUP_CODE}#signup")
email = FFaker::Internet.email
fill_in('email', with: email)
find('input[type="submit"]').click
puts "- Referred via #{email}"
sleep 0.5
end
end
end
puts "Starting bump for #{SIGNUP_CODE}"
puts
SIGNUP_REFERRALS.times do |i|
mondo = Mondo::Signup.new
mondo.referral_bump
end
puts
puts "Done! Bumped you #{SIGNUP_REFERRALS} times."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment