# hack to your viewing tastes my $listref; aande (\$listref); foreach my $show (@$listref) { print "$show\n"; }
sub aande { my $rl = shift; my $url = 'http://aande.com/perl/tv/tvlistings.pl?channel=aetv&get=t +oday&tz=pst '; my $output = get $url; my @lines = split /\n/, $output; my $program = ""; my $description = ""; my $when = ""; foreach my $x (@lines) { chomp $x; next unless $x; if ($x =~ /<FONT SIZE="-1" FACE="geneva, arial, helvetica"><B>([^< +]+)</) { $program = $1; $yay = 1; if ($program !~ /(Law & Order|Investigative Reports|American Jus +tice|Murder One)/) { $yay = 0; } } elsif ($x =~ /<FONT SIZE="-1" FACE="geneva, (helvetica, arial|aria +l, helvetic a)">(.*)$/) { my $moo = $2; $moo =~ s/<[^>]*>//g; if ($moo =~ /&nbsp;-&nbsp;/) { $when = $moo; $when =~ s/&nbsp;/ /g; } else { $description = $moo; } push @$rl, "$when $program $description\n" if $yay; $yay = 0; } } }

Replies are listed 'Best First'.
Re: Fetch Arts & Entertainment Show Details
by simon.proctor (Vicar) on Mar 28, 2002 at 14:42 UTC
    All I can say is nice effort but why not consider:
    1. LWP
    2. HTML::Parser (which also includes TokeParser)

    Just my thoughts.

      Agreed about HTML::TokeParser, but I think he was already using LWP::Simple, hence the get $url in the script. There's probably use LWP::Simple somewhere else in the code, or it's supposed to be run with -M'LWP::Simple'.

      --
      amoe