These examples use the LibWWW module for Perl; you may need to install it if you do not already have it available.
Note: using a scripting language to embed your journal is considered an "advanced" method; this tutorial assumes you have some prior experience in using this language. If you need assistance with creating a script, please consult the Perl documentation or your web host's technical support.
S1
#!/usr/bin/perl
use LWP::Simple;
print "Content-type: text/html\n\n";
print get('
http://www.livejournal.com/customview.cgi' .
'?username=exampleusername&styleid=style ID');
S2
#!/usr/bin/perl
use LWP::Simple;
print "Content-type: text/html\n\n";
print get('
http://www.livejournal.com/users/' .
'exampleusername/?s2id=S2 ID');
S1: You will need to replace style ID with the actual style ID for the style you wish to use. LiveJournal provides some basic example styles with the IDs 101 and 408. These styles are very basic, however, and cannot be easily customized. In order to use these styles, you will need to set them trusted. See the "
Guide to customview.cgi" for more information.
S2: You will need to replace S2 ID with the actual S2 style ID for the style you wish to use. Please note that it must be a style ID; layout layer IDs will not work. The S2 style IDs are listed on
Your Styles page.
Free users cannot use customview.cgi or S2 IDs. In order to embed your journal as a free user, replace the entire URL for either example with their basic journal URL: http://exampleusername.livejournal.com/.
Server Side Includes and Perl
You may already have an existing document into which you want to insert your LiveJournal where it will be loaded dynamically every time a visitor requests it. You can create a script using the examples above, and place the code to include the script below in the existing document.
Note: to get an HTML file to be server-parsed, you may need to use the .shtml extension, or set the file's execute bit; it depends on your web server and how it's configured. Please consult with your web host's technical support if you need assistance.