Skip to content

Instantly share code, notes, and snippets.

@miklb
Created August 28, 2016 03:52
Show Gist options
  • Save miklb/f3f19867f2afbe0bf3248f85f9414ff5 to your computer and use it in GitHub Desktop.
Save miklb/f3f19867f2afbe0bf3248f85f9414ff5 to your computer and use it in GitHub Desktop.
response = Net::HTTP.post_form(uri, 'target' => "#{target}", 'source' => "#{source}")
source = "#{source}"
source_slug = source.split('/')[-1]
file_ext = '.json'
source_file = [source_slug, file_ext].join("")
source_path = File.join("_data", source_file)
File.write(source_path,response.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment