Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A simple ruby bot for Sublime-giveaway
# You will need to install Tor in order for this to work.
# Install from Tor's official website.
# Set your own 'lucky' URL here
URL='http://sublimetexttips.com/giveaways/sublime-text-giveaway/?lucky=139418'
#Create temporary 10 min email address and fetch the address
require 'rubygems'
require 'json'
new_mail_json_result = `curl http://api.guerrillamail.com/ajax.php?f=get_email_address&ip=127.0.0.1&agent=Mozilla_foo_bar`
email_addr = JSON.parse(new_mail_json_result)["email_addr"];
# Here you will need the Tor browser started/running! (Use start-tor-browser!)
# Create and use headless browser
require 'watir-webdriver'
Selenium::WebDriver::Firefox::Binary.path='/home/georgi/Programs/Tor/tor-browser_en-US/start-tor-browser'
browser = Watir::Browser.new
browser.goto URL
browser.select_list(:id => 'giveaways_answer').select 'Sublime Text!!!'
browser.text_field(:id => 'giveaways_email').set email_addr
browser.button().click
puts browser.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.