I’m writing a web crawler and want to ignore URLs which link to binary files:
$exclude = %w(flv swf png jpg gif asx zip rar tar 7z gz jar js css dtd xsd ico raw mp3 mp4 wav wmv ape aac ac3 wma aiff mpg mpeg avi mov ogg mkv mka asx asf mp2 m1v m3u f4v pdf doc xls ppt pps bin exe rss xml)
How can I check the URI against one of these endings?
@url = URI.parse(url)
should be set if it doesn’t contain any of the suffixes above.
use URI#path: