Created
July 10, 2014 13:04
-
-
Save GeorgiPachov/a3eee7ba6604ff4d32b1 to your computer and use it in GitHub Desktop.
A simple ruby bot for Sublime-giveaway
This file contains 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
# 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