smol_scriptz/dl_images.rb

13 lines
217 B
Ruby
Raw Normal View History

2018-11-04 22:14:49 +01:00
# 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}"