#!/usr/bin/perl # By MerXorcist $url = "http://www.hackernews.com/"; if (@ARGV[0]){ $url .= "arch.html?" . @ARGV[0]; $date = '"' . substr($ARGV[0],0,2) . "/" . substr($ARGV[0], 2,2) . "/" . substr($ARGV[0],4,2) . '"'; } else {$date = "`date +%D`";} $date = `date -d $date '+%A, %B %d, %Y'`; $tmp = `lynx -dump -source $url`; @data = split(/\n/, $tmp); while(@data){ $tmp=shift(@data); if($tmp =~ m/Begin Day/){ while(!($tmp =~ m/End Day/)){ @file[$i] .= $tmp . "\n"; $tmp=shift(@data); } $i++; } } while(@file){ $tmp = shift(@file); $today .= $date; $today .= $tmp, "\n"; $tmp =~ tr/<>="/\n/; @urls = split(/\n/, $tmp); while(@urls){ $url = shift(@urls); if($url =~ m/http/){ $today .= $url . "
"; } } $today .= "

-------------------

"; } open(HNN,"> hnn.html"); (print HNN $today); close(HNN); print `lynx -dump -nolist hnn.html`;