howto_user wrote in howto

Embedding: ASP.NET

Contributed by: jwendl



ASP.NET makes it easy to download the embedded style.



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.NET documentation or your web host's technical support.



S1


<script language="c#" runat="server">
  private void page_load(object sender, EventArgs e) {
  lj.Text = download("http://exampleusername.livejournal.com/data/customview?styleid=style ID");
}

private string download(string URL) {
  System.Net.WebClient dl = new System.Net.WebClient();
  byte[] bhtml = dl.DownloadData(URL);
  string strPage = Encoding.ASCII.GetString(bhtml);
  dl.Dispose();
  return strPage;
}
</script>


S2


<script language="c#" runat="server">
  private void page_load(object sender, EventArgs e) {
  lj.Text = download("http://exampleusername.livejournal.com/?s2id=S2 ID");
}

private string download(string URL) {
  System.Net.WebClient dl = new System.Net.WebClient();
  byte[] bhtml = dl.DownloadData(URL);
  string strPage = Encoding.ASCII.GetString(bhtml);
  dl.Dispose();
  return strPage;
}
</script>


Then place the Literal Object for text wherever in the document you want your journal to appear.

<h2>My LiveJournal</h2>
<asp:literal id="lj" runat="server" />


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/.