Skip to content

Instantly share code, notes, and snippets.

@kgnadinger
Created November 26, 2018 19:30
Show Gist options
  • Save kgnadinger/e180e16b0616707ca252018b86992954 to your computer and use it in GitHub Desktop.
Save kgnadinger/e180e16b0616707ca252018b86992954 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'json'
while (true)
uri = URI('http://www.outbackbowl.com/')
response = Net::HTTP.get_response(uri) # => String
headers = response.to_hash
cookie_line = headers["set-cookie"].first
cookie = cookie_line.split(';').first
post_uri = URI.parse('http://www.outbackbowl.com/fanpoll.php')
http = Net::HTTP.new(post_uri.host,post_uri.port)
header = {
'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
'Host' => 'www.outbackbowl.com',
'Origin' => 'http://www.outbackbowl.com',
'Referer' => 'http://www.outbackbowl.com/',
'Cookie' => cookie
}
res = http.post(post_uri.path, 'ajax=true&poll=11&option%255B1%255D=157&option%255B2%255D=183', header)
end
require 'net/http'
require 'json'
while (true)
uri = URI('http://www.outbackbowl.com/')
response = Net::HTTP.get_response(uri) # => String
headers = response.to_hash
cookie_line = headers["set-cookie"].first
cookie = cookie_line.split(';').first
post_uri = URI.parse('http://www.outbackbowl.com/fanpoll.php')
http = Net::HTTP.new(post_uri.host,post_uri.port)
header = {
'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
'Host' => 'www.outbackbowl.com',
'Origin' => 'http://www.outbackbowl.com',
'Referer' => 'http://www.outbackbowl.com/',
'Cookie' => cookie
}
res = http.post(post_uri.path, 'ajax=true&poll=11&option%255B1%255D=157&option%255B2%255D=183', header)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment