Now I just need to figure out how to make it run automatically when I add links to my favorites.
#!perl -w use strict; my $file = "Link.html"; # File to generate. my $lcolor = "#C0C0C0"; # Color for links. my %links; for( <*.url> ) { my $link = `type "$_"` or die "$^E"; die "System Error! $?\n\$!=$!\n\$^E=$^E\n\t " if 0 != $? >> 8; die "Unusual link, '$link'\n" unless $link =~ s/^ (\[DEFAULT\]\nBASE|\[InternetShortcut\]\n) URL=([^\n]+) # This is the URL for the link. \n.*$/$2/sx; $links{+substr($_,0,-4)} = $link; } my @linkName = reverse sort keys %links; my @linkURL = @links{@linkName}; warn "Replacing $file!\n" and sleep 3 if -e $file; open FILE, "> $file" or die "Unable to open $file!\n\$!=$!\n\$^E=$^E\n +\t "; print FILE "<HTML>\n<HEAD><TITLE>Favorite Links</TITLE></HEAD>\n", "<BODY bgcolor=#000000 link=$lcolor alink=$lcolor vlink=$lc +olor>\n", "<CENTER><B><TABLE WIDTH=100%>\n" or die "Print Failed!\n\$!=$!\n\$^E=$^E\n\t "; print FILE "<TR><TD><A HREF=\"", pop( @linkURL ), "\">", pop( @linkNam +e ), ( @linkURL ? ( "</A></TD>\n<TD><A HREF=\"", pop( @linkURL ) +, "\">", pop( @linkName ) ) : " " ), "</A></TD></TR>\n" or die "Print Failed!\n\$!=$!\n\$^E=$^E\n\t " while @linkUR +L; print FILE "</TABLE>\n</BODY>\n</HTML>\n" or die "Print Failed!\n\$!=$!\n\$^E=$^E\n\t "; close FILE or die "Close Failed!\n\$!=$!\n\$^E=$^E\n\t "; ###################################################################### +######### INIT { die "Intended for use on MSWin32 system.\n" unless 'MSWin32' eq + $^O } =head1 Usage Open a command window on your MSWin32 and change directories to Your Favorites\Links\ directory. On my NT box this was: C:\WINNT\Profiles\Adam\Favorites\Links\ Run this script. You will now have a file called Links.html which makes for an excellen +t start page. =head1 Author Adam www.perlmonks.org =cut
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MSIE Favorite Start Page
by ichimunki (Priest) on Jan 12, 2001 at 17:31 UTC | |
by Adam (Vicar) on Jan 12, 2001 at 22:21 UTC | |
by ichimunki (Priest) on Jan 13, 2001 at 04:34 UTC | |
|
(Ovid) Re: MSIE Favorite Start Page
by Ovid (Cardinal) on Jan 13, 2001 at 00:26 UTC | |
|
Re: MSIE Favorite Start Page
by c-era (Curate) on Jan 13, 2001 at 02:29 UTC | |
|
Re: MSIE Favorite Start Page
by Steeeeeve (Initiate) on Jan 16, 2001 at 20:59 UTC |