#!/usr/bin/perl
use feature say;
$file = 'url.txt';
open $fh, '<', $file;
while (<$fh>) {
	chomp;
	next if $_ eq '';
	$_ =~ /^\[(.+)\] \((.+)\) (.+)$/;

	$url = $2;
	$txtfile = "2016 $3 $1";
	$txtfile =~ s/[ :…\.,\-]+/-/g;
	$txtfile =~ s/['"]//g;
	$txtfile .= '.txt';

	system("w3m -dump '$url' > '$txtfile'");
	say $txtfile;
}
