Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Pesky little URL files to HTML

by Amoe (Friar)
on Dec 23, 2001 at 16:03 UTC ( #134050=note: print w/ replies, xml ) Need Help??

in reply to Pesky little URL files to HTML

w00t. This gives me an excuse to post my Perl-IE-favorite-structure-dumper, snappily titled

#!/usr/bin/perl -w use strict; use Data::Dumper; use File::Find; my $favorites_path = shift || 'C:/Windows/Favorites'; # assumptions + are amazing my @favorites; find(\&scan, $favorites_path); print "done reading...\n"; print "outputting to dumped_favorites.txt..."; open OUT, ">dumped_favorites.txt" or die "couldn't dump favorites: $!" +; print OUT Data::Dumper->Dump([\@favorites], ['favorites']); close OUT; print "done.\n"; sub scan { return if ($_ eq '.' || $_ eq '..' || !-f $File::Find::name); my $record = {}; { local $_; open FAVORITE, "<$File::Find::name" or die "couldn't open $Fil +e::Find::name: $!"; while (<FAVORITE>) { s/URL=// and chomp and $record->{url} = $_; } close FAVORITE; } $record->{name} = substr($_, 0, -4); # can rely on as extension + is always url push @favorites, $record; print '.'; }
Fun. I've dumped mine with this many a time.

my one true love

Comment on Re: Pesky little URL files to HTML
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://134050]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2015-12-01 03:01 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (791 votes), past polls