Most programmers use multiple computers (at home and work) and it is often difficult
to share bookmarks. You can email links to the home and office, you can use a bookmark
sharing website (often requiring you to either go to the site and add the bookmark or
downloading a windows only program).
I like my solution better. If you have your own
cgi running website you can set up an email account that you can send your links too. Then
write a perl script similar to the one below that can be run by a cronjob to rip links
out of the email and save them to a flat file or database for the your website to display.
The advantage in this approach is that just about all browsers have a email link option that
is convient and easy to use. Here is a simple perl script that writes the links too a file.
Other possible features that could be added:
1. Using LWP to grab the title of the page.
2. Categorizing the link. Maybe the link can go into a holding area to be categorized later or
you can use the subject line of the email to specify the category.
#!/usr/bin/perl
use Mail::POP3Client;
use strict;
use Misc;
#Creating PopMail Object
my $pop = new Mail::POP3Client( USER => "RESU",
PASSWORD => "DROWSSAP",
HOST => "tsoh.com");
my @linkList=slurp("linkList.inc");
for (my $i=1; $i <= $pop->Count(); $i++) # Loop through messages
{
my $body = $pop->Body($i);
while ($body =~ s/(http:\/\/[^\s]*)//)
{
push @linkList, $1;
print "$1\n";
}
$pop->Delete($i);
}
$pop->Close();
dumpOut("linkList.inc", @linkList);
exit 0;
###########################
sub slurp
{
my $file =shift;
my $save = $/;
undef $/;
open FIL, "$file";
my $input= <FIL>;
close FIL;
my @list = split /$save/, $input;
$/ = $save;
return @list;
}
sub dumpOut
{
my $file = shift;
open FIL, "|uniq >$file";
while(my $content = shift)
{
print FIL $content, "\n";
}
close FIL;
}
----
I always wanted to be somebody... I guess I should have been more specific.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|