Skip to content

Instantly share code, notes, and snippets.

@thewatts
Forked from anonymous/gist:d7fc2cefe697199acf2d9ffe9f6f4fbc
Last active August 31, 2017 17:45
Show Gist options
  • Save thewatts/d4f38d75392096f444009a30e548e90c to your computer and use it in GitHub Desktop.
Save thewatts/d4f38d75392096f444009a30e548e90c to your computer and use it in GitHub Desktop.
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