Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Pesky little URL files to HTML

by Amoe (Friar)
on Dec 23, 2001 at 16:03 UTC ( [id://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 dumpfavs.pl.
#!/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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-18 14:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found