This is *great* for personal webpages, where instead of making a link list and having to constantly update it, this snippet will show visitors your favorites in real time.
You can, of course, change the windir to, for example, c:\\sitelinx , and put the links you want to be seen in the site there.
Update: I did change to Opera as OeufMayo suggested, and edited the code to reflect my Opera5 favorites:
simply add either &IEfav; or &operafav; respectively.
use CGI qw(:all);
use strict;
sub IEfav {
my $windir="C:\\windows\\favori~1";
my @FILELIST=glob ("$windir\\*.url");
my ($url, $file, @URLS);
foreach $file (@FILELIST) {
open (URLFILE, $file);
@URLS = <URLFILE>;
foreach (@URLS) {
/.*URL=(.*)/;
$url=$1;
}
$file=~/^C:\\windows\\favori~1\\(.+)\.url$/;
print "<A href=\"$url\"> $1 <\/A><BR>\n";
close URLFILE;
}
sub operafav {
my $operadir="C:\\Program Files\\Opera";
my $name="";
open (URLFILE, "$operadir\\opera5.adr");
foreach (<URLFILE>) {
if (/^\s*NAME=(.*)/) {
$name=$1; }
elsif (/^\s*URL=/) {
my $url=/^\s*URL=(.*)/;
print "<A href=\"$1\"> $name <\/A><P>\n";
}
}
close URLFILE;
}