Embedding: ASP
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 ASP documentation or your web host's technical support.
Using Microsoft.XMLHTTP
Contributed by: Pavel Titov
This is an easy way to embed your journal using the Microsoft.XMLHTTP component and IIS.
S1
<%
Response.Buffer = True
Dim xml
' Create an xmlhttp object:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
' Or, for version 3.0 of XMLHTTP, use:
' Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
' Opens the connection to the remote server.
xml.Open "GET",
"http://exampleusername.livejournal.com/data/customview?styleid=style ID",
False
' Actually Sends the request and returns the data:
xml.Send
Response.Write xml.responseText
Set xml = Nothing
%>S2
<%
Response.Buffer = True
Dim xml
' Create an xmlhttp object:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
' Or, for version 3.0 of XMLHTTP, use:
' Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
' Opens the connection to the remote server.
xml.Open "GET",
"http://exampleusername.livejournal.com/?s2id=S2 ID",
False
' Actually Sends the request and returns the data:
xml.Send
Response.Write xml.responseText
Set xml = Nothing
%>Using PerlScript
Contributed by: Ansley Ingram
Here is how to embed your LiveJournal on your site using ASP and PerlScript. However, many WinNT hosting providers don't offer PerlScript. PerlScript is included in the ActivePerl installation for NT from ActiveState.
S1
<%@language=perlscript%>
<%
use LWP::Simple;
$Response->Write(get 'http://www.livejournal.com/customview.cgi?' .
'username=exampleusername&styleid=style ID');
%>S2
<%@language=perlscript%>
<%
use LWP::Simple;
$Response->Write(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" 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 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/.
