Skip to content

Instantly share code, notes, and snippets.

Created January 29, 2015 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6dc3d61e43c34cd72401 to your computer and use it in GitHub Desktop.
Save anonymous/6dc3d61e43c34cd72401 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require "mysql"
require "pry"
require 'net/https'
require 'net/http'
begin
con = Mysql.new '10.0.3.18', 'devuser', '2fYt9D', 'devENV'
rs = con.query("
SELECT
estimable_id
FROM
estimates
WHERE
estimates.responded_when IS null
AND final_email_reminder_date LIKE curdate()
AND final_reminder_sent = 0 ")
rs.each do |row|
eid = row[0]
puts eid
uri = URI.parse('https://dev.website.com/scheduled_task/mailer/send_rfp_final_reminder/')
https = Net::HTTP.new(uri.host, uri.port)
#https.use_ssl = true
params = ({'security_token' => 'e#io92sfwei2e@#F2s9', 'estimate_id' => 'eid'})
response = https.post(uri.path, params)
puts response
end
rescue Mysql::Error => e
puts e.errno
puts e.error
ensure
con.close if con
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment