Thanks to @cbarratt for writing this. Tested on Ruby 2.2.2.
Install the dependencies:
gem install capybara ffaker poltergeist selenium-webdriver chromedriver-helper
Replace SIGNUP_CODE
with the UTM term in your referal link.
ruby script.rb
Thanks to @cbarratt for writing this. Tested on Ruby 2.2.2.
Install the dependencies:
gem install capybara ffaker poltergeist selenium-webdriver chromedriver-helper
Replace SIGNUP_CODE
with the UTM term in your referal link.
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." |