#!/usr/bin/perl -w use strict; use HTML::TokeParser::Simple; use Date::Format; use Digest::MD5 qw(md5_hex); my $file = shift; open (INPUT, "<$file") or die "Can't open file: $!"; my @links; my $cur; while () { my $stream = HTML::TokeParser::Simple->new(\$_); my $tag; while ($tag = $stream->get_token) { my $link = {}; next unless $tag->is_start_tag ('a'); next if $tag->return_attr('href') =~ m!file://!i; $link->{'link'} = $tag->return_attr('href'); $link->{'time'} = time2str("%Y-%m-%dT%H:%MZ", $tag->return_attr('add_date')); $tag = $stream->get_token; if ($tag->is_text) { $link->{'title'} = $tag->as_is; } push @links, $link; } } print '', "\n"; print '', "\n"; foreach (@links) { print '', "\n"; } print '', "\n";