#!/usr/bin/env perl Perl || die; use LWP::Simple; use HTML::TableExtract; use strict; my @motd; my $content; $content=get("http://motd.kansok.com/?langID=1&opened=.11&catID=11&csort=&sort=m.insdate%20DESC"); my $te; $te = HTML::TableExtract->new( depth => 1, count => 1 ); $te->parse($content); foreach my $ts ($te->table_states) { foreach my $row ($ts->rows) { if(defined($row->[2])) { if(ord($row->[2]) ne 160) { $row->[2] =~ s/(\s*|\n)$//g; push(@motd, $row->[2]); } } } } my $quote = $motd[rand($#motd)]; printf("%s\n", $quote);