#!/usr/bin/perl
#Created by maciunio <maciunio@ask-bsi.org> 16.05.2003

use LWP::UserAgent;
use HTML::TokeParser;

$url = "http://www.openoffice.pl";
my $ua = new LWP::UserAgent;

# CHANGE THIS TO YOUR PROXY SERVER
#$ua->env_proxy;
#$ua->proxy(['http'], 'http://localhost:8080/');

my $req = HTTP::Request->new('GET', $url);
my $res = $ua->request($req);
$res->is_success or die("didn't work $!");

my $page = $res->as_string;
my $p = HTML::TokeParser->new(\$page);

while ( my $token = $p->get_tag("img","/td") ) {
    my $text = $p->get_trimmed_text();
    if ($token->[1]{src}=~/ikony\/icon_/i) {
	    print "$text\nhttp://www.openoffice.pl\n";
    }
}
