Skip to content

Instantly share code, notes, and snippets.

@bmaland
Created April 3, 2013 19:33
Show Gist options
  • Save bmaland/5304523 to your computer and use it in GitHub Desktop.
Save bmaland/5304523 to your computer and use it in GitHub Desktop.
This script submits all 150 Ark Hunter codes to your Defiance account using PhantomJS and Selenium WebDriver (Ruby bindings). Code source: http://digiex.net/general-discussions/gaming-hangout/12462-defiance-all-150-arkfall-codes.html
# INSTRUCTIONS:
# - make sure you have ruby and phantomjs installed
# - gem install selenium-webdriver
# - start phantomjs in remote web driver mode: 'phantomjs --webdriver=4567'
# - change username/pass below
# - run the script (e.g. 'ruby defiance_ark_hunter.rb')
USERNAME = "user"
PASSWORD = "pass"
require "selenium-webdriver"
driver = Selenium::WebDriver.for(:remote, :url => "http://localhost:4567")
driver.navigate.to "http://www.defiance.com/en/my-ego"
if driver.title.include?("My EGO")
puts "Already logged in"
else
puts "Logging in"
driver.find_element(:css, 'button.sign-in').click
driver.find_element(:id, 'username').send_keys USERNAME
driver.find_element(:id, 'password').send_keys PASSWORD
driver.find_element(:id, 'submit').click
end
# Make sure all JS etc has loaded on the code entry page
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until {
driver.execute_script("return document.readyState;") == "complete"
}
puts "Submitting codes.."
CODES = DATA.read.split
CODES.each do |code|
puts code
element = driver.find_element(:id, 'arkfallcode')
element.clear
element.send_keys code
driver.find_element(:css, '#codeRedemption button.submit').click
sleep 1 # sleep between entries to avoid spamming the service
end
puts "All done!"
driver.quit
__END__
E2DFMO
kbZmVz
VO5DHS
6CIBJT
fYkqzX
RpR9Zs
Tfm2iH
fccePO
vpZk7b
XBNBPE
DKCJK3
CWAPDX
ETCTFJ
TLK9F1
AMY2ZH
WA94BD
PVXDTU
9ELBUP
YJuicp
SCsd5t
hvN5yD
8MKLUL
v2227Q
XCTFGY
TWIK9S
VGFSW9
4OSBUA
BJT9iD
LDBAMY
RQXPGX
Z5OP9L
CH8FJB
I71ADU
GBIXKI
GT1P3H
W0UODG
JJD6N5
3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