#!/usr/bin/perl use CGI qw/:standard/; use LWP::Simple qw(!head); #open(M, 'sort -nr | uniq | head -20 |'); if (param('id')) { $id = param('id'); for $i (0 .. 7) { push @id, $id + $i; } } else { $main = get("http://www.thedailyshow.com/"); @a = split(/\n/, $main); while (scalar(@a)) { $_ = shift @a; if (/
#
# if (/episodeSummary/) { # $_ = shift @a; # $_ = shift @a; # if (/\/video\/index.jhtml\?videoId=([0-9]+)/) { # $id = $1; # last; # } # } } } print header; foreach $id (@id) { print " $id "; }