Skip to content

Instantly share code, notes, and snippets.

@danielmorrison
Created October 15, 2015 14:56
Show Gist options
  • Save danielmorrison/df8444600ff2d8ae107d to your computer and use it in GitHub Desktop.
Save danielmorrison/df8444600ff2d8ae107d to your computer and use it in GitHub Desktop.
require "net/http"
require "cgi"
pid = 1
http = Net::HTTP.new('www.pepperjamnetwork.com', 80)
loop do
request = Net::HTTP::Get.new("/affiliate/optout.php?pid=#{pid}&optout=1")
cookie = CGI::Cookie.new("PHPSESSID", "REPLACE WITH ACTUAL SESSION ID")
request['Cookie'] = cookie.to_s
r = http.request(request)
puts "#{pid} " + r.body.match(/successfully opted out of newsletters for ([^<]*)/)[1]
pid += 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment