Skip to content

Instantly share code, notes, and snippets.

Created August 31, 2017 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/d7fc2cefe697199acf2d9ffe9f6f4fbc to your computer and use it in GitHub Desktop.
Save anonymous/d7fc2cefe697199acf2d9ffe9f6f4fbc to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'net/http'
require "uri"
require 'rubygems'
require 'active_support'
event_data = ActiveSupport::JSON.decode(ARGV.first)
# Get the URI. File path to filename.
filepath = event_data["inputs"]["uri"]
# Webserver update script location. Using bin to test first.
base_url = "https://requestb.in/1b22bya1"
# add the filepath as an argument
full_url = "#{base_url}?filepath=#{filepath}"
uri = URI.parse(full_url)
response = Net::HTTP.get(uri)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment