Skip to content

Instantly share code, notes, and snippets.

@lukeholder
Created May 27, 2013 13:33
Show Gist options
  • Save lukeholder/5657070 to your computer and use it in GitHub Desktop.
Save lukeholder/5657070 to your computer and use it in GitHub Desktop.
all images
all_images = Nokogiri.parse(body).css('a[href]').map { |a| a[:href] }.grep(/\.(?:png|jpg)\z/i)
all_images << Nokogiri.parse(body).css('img[src]').map { |a| a[:src] }.grep(/\.(?:png|jpg)\z/i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment