Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require "net/http"
require "uri"
require "active_support"
require "active_support/hash_with_indifferent_access"
event_data = ActiveSupport::JSON.decode(json).deep_symbolize_keys
input_uri = event_data[:inputs].first[:uri]
filename = input_uri.split("/").last
puts "+++++++++++++++++++++++++++++ RUNNING SCRIPT ++++++++++++++++++++++++++++"
begin
base_url = "https://requestb.in/1lnd2j91"
full_url = "#{base_url}?filename=#{filename}"
uri = URI.parse(full_url)
Net::HTTP.get(uri)
puts " --------------------------> !!!!!!!! SUCCESS !!!!!!!!!! "
rescue => e
puts " --------------------------> ERROR ERROR ERROR ERROR ERROR #{e}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.