Skip to content

Instantly share code, notes, and snippets.

@v1bh0r
Created January 9, 2013 08:47
Show Gist options
  • Save v1bh0r/4491653 to your computer and use it in GitHub Desktop.
Save v1bh0r/4491653 to your computer and use it in GitHub Desktop.
require 'json'
require 'net/http'
url = URI.parse('http://lpdemo.thirdpillar.com/loanpath-piedmont-web/rest/get/request/16230.json')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|http.request(req)}
parsed_json = JSON.parse res.body
document_type_details = []
parsed_json["sr.getEntityResponse"]["list"].each do |list|
list["request"]["documentGroup"]["uploadedDocuments"].each do |ud|
ud["document"].each do |d|
type_detail = d["documentType"]["documentTypeDetail"]
document_type_details << type_detail["value"] unless type_detail.nil?
end
end
end
puts document_type_details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment