Hey, here are the images you asked for.
The page breaks the browser cause of the sheer size. I could alter this to download the images for you, but i don't know what u really want to accomplish.
For posterity, here's the code:
#!/usr/bin/env ruby
require 'httparty'
require 'awesome_print'
@urls = []
def url(blob)
blob['imageUrl']
end
def img(url)
"<img src='#{url}' >"
end
%w(BLACK BLUE BROWN GRAY GREEN ORANGE PINK PURPLE RED TURQUOISE WHITE YELLOW).each do |color|
ap "processing #{color}"
processed = 1
page = 1
status = { 'totalImageCount' => '100' }
while processed < status['totalImageCount'].to_i
rslt = HTTParty.get("http://rximage.nlm.nih.gov/api/rximage/1/rxnav?&resolution=full&color=#{color}&rPage=#{page}&rPageSize=100")
status = rslt['replyStatus']
ap processed
ap status
rslt['nlmRxImages'].each do |image|
@urls << url(image)
end
processed += status['imageCount']
page += 1
end
end
File.write(
'/tmp/out.html',
@urls.map { |url| img(url) }.join('</br>')
)