-
-
Save anonymous/6dc3d61e43c34cd72401 to your computer and use it in GitHub Desktop.
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
#!/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