#!/usr/bin/perl
# Created by maciunio <maciunio@ask-bsi.org> 13.05.2003
# I know this is POOR perl, but i don't know this lang. If you DO - email me with a better programming
#############################################################################################
# Copyright 2003, Maciej "maciunio" Paczesny <maciunio (at) ask - bsi (dot) org>
#                 Lukasz "lookanio" Purgal <lookanio (at) interia (dot) pl>
#
#    This file is part of "Polish News Module".
#
#    "Polish News Module" is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    "Polish News Module" is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with "Polish News Module"; if not, write to the Free Software
#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#############################################################################################

use HTML::TokeParser;
use LWP::Simple;

my $URL = "http://www.rp.pl/zakladkaNsc6/netscape-tab.html";
my $arr = "";

my $page=get($URL);
my $p = HTML::TokeParser->new(\$page);

my $licz = 0;
while ( my $token = $p->get_tag("li") && $licz < 14) {
    my $text = $p->get_trimmed_text("/li");
    $arr .= "$text\nhttp:/\/\www.rp.pl\n";
    $licz = $licz + 1;
}

print $arr;
