Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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 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


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (11)
As of 2015-07-01 20:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls