-
-
Save anonymous/38eafd897b5690e1b182 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', 'password', 'dev' | |
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 row.join("\s") | |
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 | |
https.set_form_data = ({'security_token' => 'sldf43535kj@#@#hsdfkh', 'estimate_id' => 'eid'}) | |
res = https.post(uri.path, params) | |
puts res | |
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