2 ms·
Without the crazy dependencies: #!/usr/bin/perl use strict; use warnings; use LWP::Simple; my %urls = (); process( "http://news.ycombinator.com/su
by mike-cardwell 16y ago
Without the crazy dependencies:
#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
my %urls = ();
process( "http://news.ycombinator.com/submitted?id=$ARGV[0]" );
print join("\n",sort keys %urls)."\n";
sub process {
my $html = get( $_[0] );
$html =~ s#<td class="title"><a href="(http[^"]+)#$urls{$1}++#eg;
process("http://news.ycombinator.com$1") if $html =~ m#<a href="(/x\?fnid=[^"]+)" rel="nofollow">More</a>#;
}