smol_scriptz/dl_images.rb

14 lines
268 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'
2019-07-10 08:44:27 +02:00
# url = gets.chomp
url = 'http://boards.4chan.org/d/thread/8571429'
2018-11-04 22:14:49 +01:00
url = url.open
result = URI.extract(url).select { |a| a[/\.(?:gif|png|jpg|jpeg)\b/] }
cmd "wget #{result}"