ljc.pl - A sample script to link LiveJournal users
# Link "ljuser1" to "ljuser2" ./ljc.pl ljuser1 ljuser2
This sample script uses the popular weblog site LiveJournal http://www.livejournal.com and creates the necessary framework for Algorithm::SixDegrees to link users together into a chain.
Algorithm::SixDegrees
Before running the script for the first time, please read http://www.livejournal.com/bots/. In short, you will need to change the $agent variable; it must contain your email address.
$agent
Also, if you intend to run this more than a couple times, please implement some form of results caching. It could be as simple as a tied DBM file; just please don't abuse the resource, as other people rely on this courtesy LiveJournal extends for their own uses.
tie
It will then try to connect the two LiveJournal users given on the command line.
A web version of this utility is at http://www.petekrawczyk.com/lj_connect/. It has extra options, and will show the users as it progresses. You may not get the same result on the web version as this sample, but they should both be equivalent lengths.
To install Algorithm::SixDegrees, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Algorithm::SixDegrees
CPAN shell
perl -MCPAN -e shell install Algorithm::SixDegrees
For more information on module installation, please visit the detailed CPAN module installation guide.