# frozen_string_literal: true require 'nokogiri' require 'open-uri' puts 'what to crawl' url = gets.chomp url = url.open result = URI.extract(url).select { |a| a[/\.(?:gif|png|jpg|jpeg)\b/] } cmd "wget #{result}"