init
This commit is contained in:
111
livejournal/doc/raw/build/api/api2db.pl
Executable file
111
livejournal/doc/raw/build/api/api2db.pl
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
|
||||
my ($opt_include, $opt_exclude, $opt_book);
|
||||
die unless GetOptions(
|
||||
'include=s' => \$opt_include,
|
||||
'exclude=s' => \$opt_exclude,
|
||||
'book=s' => \$opt_book,
|
||||
);
|
||||
die "Unknown arguments.\n" if @ARGV;
|
||||
die "Can't exclude and include at same time!\n" if $opt_include && $opt_exclude;
|
||||
|
||||
unless (-d $ENV{'LJHOME'}) {
|
||||
die "\$LJHOME not set.\n";
|
||||
}
|
||||
|
||||
require "$ENV{'LJHOME'}/doc/raw/build/docbooklib.pl";
|
||||
|
||||
chdir $ENV{'LJHOME'} or die "Can't cd to $ENV{'LJOME'}\n";
|
||||
|
||||
unless ($opt_book) { $opt_book = "ljp"; }
|
||||
|
||||
### apidoc.pl does all the hard work.
|
||||
my $VAR1;
|
||||
my $param;
|
||||
$param = "--include=$opt_include" if $opt_include;
|
||||
$param = "--exclude=$opt_exclude" if $opt_exclude;
|
||||
eval `$ENV{'LJHOME'}/bin/apidoc.pl --conf=$ENV{'LJHOME'}/doc/raw/build/api/apidoc.conf $param`;
|
||||
my $api = $VAR1;
|
||||
|
||||
print "<reference id=\"$opt_book.api.ref\">\n";
|
||||
print " <title>API Documentation</title>\n";
|
||||
|
||||
foreach my $func (sort keys %$api) {
|
||||
my $f = $api->{$func};
|
||||
my $argstring;
|
||||
|
||||
my $canonized = canonize("func" , $func, "", $opt_book);
|
||||
print " <refentry id=\"$canonized\">\n";
|
||||
|
||||
### name and short description:
|
||||
cleanse(\$f->{'des'}, $opt_book);
|
||||
print " <refnamediv>\n";
|
||||
print " <refname>$func</refname>\n";
|
||||
print " <refpurpose>$f->{'des'}</refpurpose>\n";
|
||||
print " </refnamediv>\n";
|
||||
|
||||
### usage:
|
||||
print " <refsynopsisdiv>\n";
|
||||
print " <title>Use</title>\n";
|
||||
print " <funcsynopsis>\n";
|
||||
print " <funcprototype>\n";
|
||||
print " <funcdef><function>$func</function></funcdef>\n";
|
||||
if (@{$f->{'args'}}) {
|
||||
foreach my $arg (@{$f->{'args'}}) {
|
||||
print " <paramdef><parameter>$arg->{'name'}</parameter></paramdef>\n";
|
||||
}
|
||||
}
|
||||
print " </funcprototype>\n";
|
||||
print " </funcsynopsis>\n";
|
||||
print " </refsynopsisdiv>\n";
|
||||
|
||||
### arguments:
|
||||
if (@{$f->{'args'}}) {
|
||||
print " <refsect1>\n";
|
||||
print " <title>Arguments</title>\n";
|
||||
print " <itemizedlist>\n";
|
||||
|
||||
foreach my $arg (@{$f->{'args'}}) {
|
||||
print " <listitem><formalpara>\n";
|
||||
print " <title>$arg->{'name'}</title>\n";
|
||||
my $des = $arg->{'des'};
|
||||
cleanse(\$des, $opt_book);
|
||||
print " <para>$des</para>\n";
|
||||
print " </formalpara></listitem>\n";
|
||||
}
|
||||
print " </itemizedlist>\n";
|
||||
print " </refsect1>\n";
|
||||
}
|
||||
|
||||
### info:
|
||||
if ($f->{'info'}) {
|
||||
cleanse(\$f->{'info'}, $opt_book);
|
||||
print " <refsect1>\n";
|
||||
print " <title>Info</title>\n";
|
||||
print " <para>$f->{'info'}</para>\n";
|
||||
print " </refsect1>\n";
|
||||
}
|
||||
|
||||
### source file:
|
||||
print " <refsect1>\n";
|
||||
print " <title>Source:</title>\n";
|
||||
print " <para><filename>$f->{'source'}</filename></para>\n";
|
||||
print " </refsect1>\n";
|
||||
|
||||
### returning:
|
||||
if ($f->{'returns'}) {
|
||||
cleanse(\$f->{'returns'}, $opt_book);
|
||||
print " <refsect1>\n";
|
||||
print " <title>Returns:</title>\n";
|
||||
print " <para>$f->{'returns'}</para>\n";
|
||||
print " </refsect1>\n";
|
||||
}
|
||||
|
||||
print " </refentry>\n";
|
||||
}
|
||||
|
||||
print "</reference>\n";
|
||||
19
livejournal/doc/raw/build/api/apidoc.conf
Executable file
19
livejournal/doc/raw/build/api/apidoc.conf
Executable file
@@ -0,0 +1,19 @@
|
||||
basedir $LJHOME
|
||||
dodir cgi-bin
|
||||
|
||||
class general General
|
||||
class api API
|
||||
class db Database
|
||||
class logging Logging
|
||||
class time Date & Time
|
||||
class component Components
|
||||
class s1 Style System v1
|
||||
class security Security
|
||||
class web Web Programming
|
||||
class text Text Processing
|
||||
|
||||
arg dbarg Deprecated; a master database handle ($dbh) or a master/slave set of database handles ($dbs).
|
||||
arg hookname Name of hook. See doc/hooks.txt.
|
||||
arg u A hashref of a row from the user table, sometimes called a "user object". Although only initially a row from the user table, gets a lot of tacked onto it from various other LJ API functions.
|
||||
arg remote Hashref of remote user containing \'user\' and \'userid\' keys if obtained from [func[LJ::get_remote]] or just \'user\' if untrusted and obtained from [func[LJ::get_remote_noauth]].
|
||||
arg dbcm Cluster master database handle
|
||||
15
livejournal/doc/raw/build/caps/cap-local.pl
Executable file
15
livejournal/doc/raw/build/caps/cap-local.pl
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
use vars qw(%cap_local);
|
||||
|
||||
$caps_local{'paid'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User has paid for their account type.',
|
||||
};
|
||||
$caps_local{'fastserver'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User has access to the faster (paid) servers.',
|
||||
};
|
||||
167
livejournal/doc/raw/build/caps/cap2db.pl
Executable file
167
livejournal/doc/raw/build/caps/cap2db.pl
Executable file
@@ -0,0 +1,167 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
unless (-d $ENV{'LJHOME'}) {
|
||||
die "\$LJHOME not set.\n";
|
||||
}
|
||||
|
||||
use vars qw(%caps_general %caps_local);
|
||||
|
||||
my $LJHOME = $ENV{'LJHOME'};
|
||||
|
||||
require "$LJHOME/doc/raw/build/docbooklib.pl";
|
||||
|
||||
if (-e "$LJHOME/doc/raw/build/caps/cap-local.pl") {
|
||||
require "$LJHOME/doc/raw/build/caps/cap-local.pl";
|
||||
}
|
||||
|
||||
$caps_general{'checkfriends'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User can use checkfriends.',
|
||||
};
|
||||
$caps_general{'checkfriends_interval'} = {
|
||||
type => 'integer',
|
||||
desc => 'Time before clients can call "checkfriends" (use min).',
|
||||
};
|
||||
$caps_general{'synd_create'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User can create syndicated accounts.',
|
||||
};
|
||||
$caps_general{'findsim'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User is able to use the similar interests matching feature',
|
||||
};
|
||||
$caps_general{'friendsfriendsview'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User\'s "friends of friends" /friendsfriends view is enabled',
|
||||
};
|
||||
$caps_general{'friendsviewupdate'} = {
|
||||
type => 'integer',
|
||||
desc => 'After how many seconds user see new friends view items.',
|
||||
};
|
||||
$caps_general{'makepoll'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User can user make a poll',
|
||||
};
|
||||
$caps_general{'maxfriends'} = {
|
||||
type => 'integer',
|
||||
desc => 'Maximum number of friends that are allowed per account',
|
||||
};
|
||||
$caps_general{'moodthemecreate'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User can create new mood themes.',
|
||||
};
|
||||
$caps_general{'readonly'} = {
|
||||
type => 'boolean',
|
||||
desc => 'No writes to the database for this journal are permitted. '.
|
||||
'(this is used by cluster management tool: a journal is readonly '.
|
||||
'while it is being moved to another cluster)',
|
||||
};
|
||||
$caps_general{'styles'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User can create & use their own styles.',
|
||||
};
|
||||
$caps_general{'textmessage'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User can use text messaging.',
|
||||
};
|
||||
$caps_general{'todomax'} = {
|
||||
type => 'integer',
|
||||
desc => 'Maximum number of todo items allowed',
|
||||
};
|
||||
$caps_general{'todosec'} = {
|
||||
type => 'boolean',
|
||||
desc => 'Can user make non-public todo items?',
|
||||
};
|
||||
$caps_general{'userdomain'} = {
|
||||
type => 'boolean',
|
||||
desc => 'Can view journal at http://user.$LJ::DOMAIN/',
|
||||
};
|
||||
$caps_general{'useremail'} = {
|
||||
type => 'boolean',
|
||||
desc => 'User has email address @$LJ::USER_DOMAIN',
|
||||
};
|
||||
$caps_general{'userpics'} = {
|
||||
type => 'integer',
|
||||
desc => 'Maximum number of user pictures allowed.',
|
||||
};
|
||||
$caps_general{'hide_email_after'} = {
|
||||
type => 'integer',
|
||||
desc => "Hide an account's email address who has not used the site in a time period longer than the given setting. ".
|
||||
"If 0, the email is never hidden. The time period is in days.",
|
||||
};
|
||||
$caps_general{'weblogscom'} = {
|
||||
type => 'boolean',
|
||||
desc => "Allow the account to ping weblogs.com with new updates",
|
||||
};
|
||||
$caps_general{'full_rss'} = {
|
||||
type => 'boolean',
|
||||
desc => "Show the full text in the RSS view",
|
||||
};
|
||||
$caps_general{'get_comments'} = {
|
||||
type => 'boolean',
|
||||
desc => "Can receive comments",
|
||||
};
|
||||
$caps_general{'leave_comments'} = {
|
||||
type => 'boolean',
|
||||
desc => "Can leave comments on other accounts",
|
||||
};
|
||||
$caps_general{'can_post'} = {
|
||||
type => 'boolean',
|
||||
desc => "Can post new entries",
|
||||
};
|
||||
$caps_general{'rateperiod-failed_login'} = {
|
||||
type => 'integer',
|
||||
desc => "The period of time an account can try to repeat logging in for",
|
||||
};
|
||||
$caps_general{'rateallowed-failed_login'} = {
|
||||
type => 'integer',
|
||||
desc => "How many times a period an account can try to log in for",
|
||||
};
|
||||
$caps_general{'s2everything'} = {
|
||||
type => 'boolean',
|
||||
desc => "Can use all properties of S2 layouts",
|
||||
};
|
||||
$caps_general{'friendspopwithfriends'} = {
|
||||
type => 'boolean',
|
||||
desc => "Can use <quote>Popular with Friends</quote> tool",
|
||||
};
|
||||
$caps_general{'emailpost'} = {
|
||||
type => 'boolean',
|
||||
desc => "User has ability to post via an email gateway.",
|
||||
};
|
||||
$caps_general{'disable_can_post'} = {
|
||||
type => "boolean",
|
||||
desc => "Posting new journal entries is disabled for this account, presumably because a trial period of some sort has expired.",
|
||||
};
|
||||
$caps_general{'disable_get_comments'} = {
|
||||
type => "boolean",
|
||||
desc => "Getting new comments in this journal is disabled, presumably because a trial period of some sort has expired.",
|
||||
};
|
||||
$caps_general{'disable_leave_comments'} = {
|
||||
type => "boolean",
|
||||
desc => "This account can no longer leave comments, presumably because a trial period of some sort has expired.",
|
||||
};
|
||||
|
||||
|
||||
sub dump_caps
|
||||
{
|
||||
my $title = shift;
|
||||
my $caps = shift;
|
||||
print "<variablelist>\n <title>$title Capabilities</title>\n";
|
||||
foreach my $cap (sort keys %$caps)
|
||||
{
|
||||
print " <varlistentry>\n";
|
||||
print " <term><literal role=\"cap.class\">$cap</literal></term>\n";
|
||||
print " <listitem><para>\n";
|
||||
print " (<emphasis>$caps->{$cap}->{'type'}</emphasis>) - $caps->{$cap}->{'desc'}\n";
|
||||
print " </para></listitem>\n";
|
||||
print " </varlistentry>\n";
|
||||
}
|
||||
print "</variablelist>\n";
|
||||
}
|
||||
|
||||
dump_caps("General", \%caps_general);
|
||||
if (%caps_local) { dump_caps("Local", \%caps_local); }
|
||||
13
livejournal/doc/raw/build/chunk.xsl
Executable file
13
livejournal/doc/raw/build/chunk.xsl
Executable file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="xsl-docbook/html/chunk.xsl"/>
|
||||
|
||||
<xsl:include href="ljdocs2html.xsl"/>
|
||||
|
||||
<xsl:param name="chunk.section.depth" select="1"/>
|
||||
|
||||
<xsl:param name="chunk.first.sections" select="1"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
39
livejournal/doc/raw/build/console/console2db.pl
Executable file
39
livejournal/doc/raw/build/console/console2db.pl
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
unless (-d $ENV{'LJHOME'}) {
|
||||
die "\$LJHOME not set.\n";
|
||||
}
|
||||
|
||||
require "$ENV{'LJHOME'}/doc/raw/build/docbooklib.pl";
|
||||
require "$ENV{'LJHOME'}/cgi-bin/console.pl";
|
||||
my $ret;
|
||||
|
||||
$ret .= "<variablelist><title>Administrative Console Commands</title>\n";
|
||||
foreach my $cmdname (sort keys %LJ::Con::cmd) {
|
||||
my $cmd = $LJ::Con::cmd{$cmdname};
|
||||
next if ($cmd->{'hidden'});
|
||||
$ret .= "<varlistentry>\n";
|
||||
$ret .= " <term><literal role=\"console.command\">$cmdname</literal></term>\n";
|
||||
my $des = $cmd->{'des'};
|
||||
cleanse(\$des);
|
||||
$ret .= " <listitem><para>\n$des\n";
|
||||
if ($cmd->{'args'}) {
|
||||
$ret .= " <itemizedlist>\n <title>Arguments:</title>\n";
|
||||
my @args = @{$cmd->{'args'}};
|
||||
while (my ($argname, $argdes) = splice(@args, 0, 2)) {
|
||||
$ret .= " <listitem><formalpara>";
|
||||
$ret .= "<title>$argname</title>\n";
|
||||
cleanse(\$argdes);
|
||||
$ret .= " <para>$argdes</para>\n";
|
||||
$ret .= " </formalpara></listitem>\n";
|
||||
}
|
||||
$ret .= " </itemizedlist>\n";
|
||||
}
|
||||
$ret .= " </para></listitem>\n";
|
||||
$ret .= "</varlistentry>\n";
|
||||
}
|
||||
$ret .= "</variablelist>\n";
|
||||
print $ret;
|
||||
87
livejournal/doc/raw/build/db/db2ref.xsl
Executable file
87
livejournal/doc/raw/build/db/db2ref.xsl
Executable file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- LiveJournal XSLT stylesheet created by Tribeless Nomad (AJW) -->
|
||||
<!-- converts DB schema documentation from custom XML to DocBook XML -->
|
||||
<!-- The source document should comply with dbschema.dtd version 1.0.4. -->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" />
|
||||
|
||||
<xsl:template match="/">
|
||||
|
||||
<xsl:for-each select="dbschema/dbtbl">
|
||||
<refentry><xsl:attribute name="id"><xsl:text>ljp.dbschema.</xsl:text><xsl:value-of select="@id"/></xsl:attribute>
|
||||
<refnamediv>
|
||||
<refname><database class="table"><xsl:value-of select="name"/></database></refname>
|
||||
<refpurpose><xsl:apply-templates select="description/node()"/></refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title><database class="table"><xsl:value-of select="name"/></database></title>
|
||||
<informaltable><tgroup cols="5">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Column name</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Null</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:for-each select="dbcol">
|
||||
<row>
|
||||
<entry><database class="field"><xsl:value-of select="name"/></database></entry>
|
||||
<entry><type><xsl:value-of select="@type"/></type></entry>
|
||||
<entry align="center"><xsl:if test="@required[.='false']">YES</xsl:if></entry>
|
||||
<entry align="center"><xsl:if test="@default"><literal role="value"><xsl:value-of select="@default"/></literal></xsl:if></entry>
|
||||
<entry><xsl:apply-templates select="description/node()"/></entry>
|
||||
</row>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</tgroup></informaltable>
|
||||
<xsl:choose>
|
||||
<xsl:when test="dbkey">
|
||||
<informaltable><tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Key name</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Column(s)</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:for-each select="dbkey">
|
||||
<row>
|
||||
<entry>
|
||||
<database class="key1"><xsl:value-of select="@name"/></database>
|
||||
</entry>
|
||||
<entry>
|
||||
<type><xsl:value-of select="@type"/></type>
|
||||
</entry>
|
||||
<entry>
|
||||
<xsl:for-each select="@colids">
|
||||
<database class="field"><xsl:value-of select="name"/></database>
|
||||
|
||||
<xsl:if test="position() != last()">, </xsl:if>
|
||||
</xsl:for-each>
|
||||
</entry>
|
||||
</row>
|
||||
</xsl:for-each>
|
||||
</tbody>
|
||||
</tgroup></informaltable>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<para>No keys defined.</para>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
<xsl:template match="dbtblref"><link><xsl:attribute name="linkend"><xsl:text>ljp.dbschema.</xsl:text><xsl:value-of select="@tblid"/></xsl:attribute><database class="table"><xsl:value-of select="."/></database></link></xsl:template>
|
||||
<xsl:template match="dbcolref"><database class="field"><xsl:value-of select="."/></database></xsl:template>
|
||||
|
||||
<!-- I don't think the following template should be necessary, but in IE5 it is: -->
|
||||
<xsl:template match="text()"><xsl:value-of select="."/></xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
23
livejournal/doc/raw/build/db/dbschema.dtd
Executable file
23
livejournal/doc/raw/build/db/dbschema.dtd
Executable file
@@ -0,0 +1,23 @@
|
||||
<!ELEMENT dbschema (dbtbl+)>
|
||||
|
||||
<!ELEMENT dbtbl (name, description?, dbcol+, dbkey*, data?)>
|
||||
<!ATTLIST dbtbl id ID #IMPLIED public_browsable (0|1) #IMPLIED>
|
||||
|
||||
<!ELEMENT dbcol (name, description?)>
|
||||
<!ATTLIST dbcol type CDATA #REQUIRED size CDATA #IMPLIED required (true|false) #REQUIRED default CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT dbkey EMPTY>
|
||||
<!ATTLIST dbkey name NMTOKEN #IMPLIED type (INDEX|UNIQUE|PRIMARY) #REQUIRED colids IDREFS #REQUIRED>
|
||||
|
||||
<!ELEMENT data ANY>
|
||||
|
||||
<!ELEMENT name (#PCDATA)>
|
||||
|
||||
<!ELEMENT description (#PCDATA | dbtblref | dbcolref)*>
|
||||
|
||||
<!ELEMENT dbtblref (#PCDATA)>
|
||||
<!ATTLIST dbtblref tblid IDREF #REQUIRED>
|
||||
|
||||
<!ELEMENT dbcolref (#PCDATA)>
|
||||
<!ATTLIST dbcolref colid IDREF #REQUIRED>
|
||||
|
||||
125
livejournal/doc/raw/build/db/dbschema.pl
Executable file
125
livejournal/doc/raw/build/db/dbschema.pl
Executable file
@@ -0,0 +1,125 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
require "$ENV{'LJHOME'}/cgi-bin/ljlib.pl";
|
||||
|
||||
my $dbr = LJ::get_dbh("slave", "master");
|
||||
my $sth;
|
||||
|
||||
sub magic_links
|
||||
{
|
||||
my $des = shift;
|
||||
$$des =~ s!<!<!g;
|
||||
$$des =~ s!>!>!g;
|
||||
$$des =~ s!\[dbtable\[(\w+?)\]\]!<dbtblref tblid="$1">$1</dbtblref>!g;
|
||||
}
|
||||
|
||||
sub dump_xml
|
||||
{
|
||||
my $tables = shift;
|
||||
|
||||
print "<?xml version=\"1.0\" ?>\n";
|
||||
print "<!DOCTYPE dbschema SYSTEM \"dbschema.dtd\">\n";
|
||||
print "<dbschema>\n";
|
||||
foreach my $table (sort keys %$tables)
|
||||
{
|
||||
print "<dbtbl id=\"$table\">\n";
|
||||
|
||||
# table name
|
||||
print "<name>$table</name>\n";
|
||||
|
||||
# description of table
|
||||
if ($tables->{$table}->{'des'}) {
|
||||
my $des = $tables->{$table}->{'des'};
|
||||
magic_links(\$des);
|
||||
print "<description>$des</description>\n";
|
||||
}
|
||||
|
||||
# columns
|
||||
foreach my $col (@{$tables->{$table}->{'cols'}})
|
||||
{
|
||||
print "<dbcol id=\"$table.$col->{'name'}\" type=\"$col->{'type'}\" required=\"$col->{'required'}\" default=\"$col->{'default'}\">\n";
|
||||
print "<name>$col->{'name'}</name>\n";
|
||||
if ($col->{'des'}) {
|
||||
my $des = $col->{'des'};
|
||||
magic_links(\$des);
|
||||
print "<description>$des</description>\n";
|
||||
}
|
||||
print "</dbcol>\n";
|
||||
}
|
||||
|
||||
# indexes
|
||||
foreach my $indexname (sort keys %{$tables->{$table}->{'index'}})
|
||||
{
|
||||
my $index = $tables->{$table}->{'index'}->{$indexname};
|
||||
|
||||
print "<dbkey name=\"$indexname\" type=\"$index->{'type'}\" colids=\"", join(" ", @{$index->{'cols'}}), "\" />\n";
|
||||
}
|
||||
|
||||
print "</dbtbl>\n";
|
||||
}
|
||||
print "</dbschema>\n";
|
||||
}
|
||||
|
||||
my %table;
|
||||
my %coldes;
|
||||
|
||||
foreach (`$ENV{'LJHOME'}/bin/upgrading/update-db.pl --listtables`) {
|
||||
chomp;
|
||||
$table{$_} = {};
|
||||
}
|
||||
|
||||
$sth = $dbr->prepare("SELECT tablename, public_browsable, des FROM schematables");
|
||||
$sth->execute;
|
||||
while (my ($name, $public, $des) = $sth->fetchrow_array) {
|
||||
next unless (defined $table{$name});
|
||||
$table{$name} = { 'public' => $public, 'des' => $des };
|
||||
}
|
||||
|
||||
$sth = $dbr->prepare("SELECT tablename, colname, des FROM schemacols");
|
||||
$sth->execute;
|
||||
while (my ($table, $col, $des) = $sth->fetchrow_array) {
|
||||
next unless (defined $table{$table});
|
||||
$coldes{$table}->{$col} = $des;
|
||||
}
|
||||
|
||||
foreach my $table (sort keys %table)
|
||||
{
|
||||
$sth = $dbr->prepare("DESCRIBE $table");
|
||||
$sth->execute;
|
||||
while (my $r = $sth->fetchrow_hashref)
|
||||
{
|
||||
my $col = {};
|
||||
$col->{'name'} = $r->{'Field'};
|
||||
|
||||
my $type = $r->{'Type'};
|
||||
$type =~ s/int\(\d+\)/int/g;
|
||||
if ($r->{'Extra'} eq "auto_increment") {
|
||||
$type .= " auto_increment";
|
||||
}
|
||||
$col->{'type'} = $type;
|
||||
|
||||
$col->{'default'} = $r->{'Default'};
|
||||
$col->{'required'} = $r->{'Null'} eq "YES" ? "false" : "true";
|
||||
|
||||
$col->{'des'} = $coldes{$table}->{$r->{'Field'}};
|
||||
|
||||
push @{$table{$table}->{'cols'}}, $col;
|
||||
}
|
||||
|
||||
$sth = $dbr->prepare("SHOW INDEX FROM $table");
|
||||
$sth->execute;
|
||||
while (my $r = $sth->fetchrow_hashref)
|
||||
{
|
||||
my $name = $r->{'Key_name'};
|
||||
my $type = $r->{'Non_unique'} ? "INDEX" : "UNIQUE";
|
||||
if ($name eq "PRIMARY") { $type = "PRIMARY"; }
|
||||
|
||||
$table{$table}->{'index'}->{$name}->{'type'} = $type;
|
||||
push @{$table{$table}->{'index'}->{$name}->{'cols'}}, "$table.$r->{'Column_name'}";
|
||||
}
|
||||
}
|
||||
|
||||
dump_xml(\%table);
|
||||
56
livejournal/doc/raw/build/docbooklib.pl
Executable file
56
livejournal/doc/raw/build/docbooklib.pl
Executable file
@@ -0,0 +1,56 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
my %special = (
|
||||
'logprops' => '<xref linkend="ljp.csp.proplist" />',
|
||||
'ljhome' => '<envar><link linkend="lj.install.ljhome">\$LJHOME</link></envar>',
|
||||
'helpurls' => '<xref linkend="lj.install.ljconfig.helpurls" />',
|
||||
'disabled' => '<xref linkend="lj.install.ljconfig.disabled" />',
|
||||
'reluser' => '<xref linkend="ljp.db.reluser" />',
|
||||
'cspversion' => '<xref linkend="ljp.csp.versions" />',
|
||||
);
|
||||
|
||||
sub cleanse
|
||||
{
|
||||
my $text = shift;
|
||||
# Escape bare ampersands
|
||||
$$text =~ s/&(?!(?:[a-zA-Z0-9]+|#\d+);)/&/g;
|
||||
# Escape HTML
|
||||
$$text =~ s/</</g;
|
||||
$$text =~ s/>/>/g;
|
||||
# Convert intended markup to docbook
|
||||
$$text =~ s/<b>(.+?)<\/b>/<emphasis role='bold'>$1<\/emphasis>/ig;
|
||||
$$text =~ s/<tt>(.+?)<\/tt>/<literal>$1<\/literal>/ig;
|
||||
$$text =~ s/<i>(.+?)<\/i>/<replaceable type='parameter'>$1<\/replaceable>/ig;
|
||||
$$text =~ s/<u>(.+?)<\/u>/<emphasis>$1<\/emphasis>/ig;
|
||||
xlinkify($text);
|
||||
}
|
||||
|
||||
sub canonize
|
||||
{
|
||||
my $type = lc(shift);
|
||||
my $name = shift;
|
||||
my $function = shift;
|
||||
my $string = lc($name);
|
||||
if ($type eq "func") {
|
||||
$string =~ s/::/./g;
|
||||
my $format = "ljp.api.$string";
|
||||
$string = $function eq "link" ? "<link linkend=\"$format\">$name</link>" : $format;
|
||||
} elsif($type eq "dbtable") {
|
||||
$string = "<link linkend=\"ljp.dbschema.$string\">$name</link>";
|
||||
} elsif($type eq "special") {
|
||||
$string = %special->{$string};
|
||||
} elsif($type eq "ljconfig") {
|
||||
$string = "<xref linkend=\"ljconfig.$string\" />";
|
||||
} elsif($type eq "var") {
|
||||
$string = "<xref linkend=\"ljp.styles.s1.$string\" />";
|
||||
}
|
||||
}
|
||||
|
||||
sub xlinkify
|
||||
{
|
||||
my $a = shift;
|
||||
$$a =~ s/\[(\S+?)\[(\S+?)\]\]/canonize($1, $2, "link")/ge;
|
||||
}
|
||||
185
livejournal/doc/raw/build/generate.pl
Executable file
185
livejournal/doc/raw/build/generate.pl
Executable file
@@ -0,0 +1,185 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
use Getopt::Long;
|
||||
|
||||
my $XSL_VERSION_RECOMMENDED = "1.55.0";
|
||||
|
||||
my $opt_clean;
|
||||
my ($opt_myxsl, $opt_getxsl, $opt_single);
|
||||
exit 1 unless GetOptions('clean' => \$opt_clean,
|
||||
'myxsl' => \$opt_myxsl,
|
||||
'getxsl' => \$opt_getxsl,
|
||||
'single' => \$opt_single,
|
||||
);
|
||||
|
||||
my $home = $ENV{'LJHOME'};
|
||||
require "$home/cgi-bin/ljlib.pl";
|
||||
$ENV{'SGML_CATALOG_FILES'} = $LJ::CATALOG_FILES || "/usr/share/sgml/docbook/dtd/xml/4.1/docbook.cat";
|
||||
|
||||
unless (-e $ENV{'SGML_CATALOG_FILES'}) {
|
||||
die "Catalog files don't exist. Either set \$LJ::CATALOG_FILES, install docbook-xml (on Debian), or symlink $ENV{'SGML_CATALOG_FILES'} to XML DocBook 4.1's docbook.cat.";
|
||||
}
|
||||
|
||||
die "Siteroot not set" unless $LJ::SITEROOT;
|
||||
open F, "> $home/doc/raw/entities/pregen.ent" or die "Can't open pregen.ent : $!";
|
||||
{
|
||||
print F "<!ENTITY siteroot '$LJ::SITEROOT'>\n";
|
||||
}
|
||||
close F;
|
||||
|
||||
if ($opt_getxsl) {
|
||||
chdir "$home/doc/raw/build" or die "Where is build dir?";
|
||||
unlink "xsl-docbook.tar.gz";
|
||||
my $fetched = 0;
|
||||
my $url = "http://www.livejournal.org/misc/xsl-docbook.tar.gz";
|
||||
my @fetcher = ([ 'wget', "wget $url", ],
|
||||
[ 'lynx', "lynx -source $url > xsl-docbook.tar.gz", ],
|
||||
[ 'GET', "GET $url > xsl-docbook.tar.gz", ]);
|
||||
foreach my $fet (@fetcher) {
|
||||
next if $fetched;
|
||||
print "Looking for $fet->[0] ...\n";
|
||||
next unless `which $fet->[0]`;
|
||||
print "RUNNING: $fet->[1]\n";
|
||||
system($fet->[1])
|
||||
and die "Error running $fet->[0]. Interrupted?\n";
|
||||
$fetched = 1;
|
||||
}
|
||||
unless ($fetched) {
|
||||
die "Couldn't find a program to download things from the web. I looked for:\n\t".
|
||||
join(", ", map { $_->[0] } @fetcher) . "\n";
|
||||
}
|
||||
system("tar", "zxvf", "xsl-docbook.tar.gz")
|
||||
and die "Error extracting xsl-doxbook.tar.gz; have GNU tar?\n";
|
||||
}
|
||||
|
||||
my $output_dir = "$home/htdocs/doc/server";
|
||||
my $docraw_dir = "$home/doc/raw";
|
||||
my $XSL = "$docraw_dir/build/xsl-docbook";
|
||||
my $stylesheet = "$XSL/html/chunk.xsl";
|
||||
open (F, "$XSL/VERSION");
|
||||
my $XSL_VERSION;
|
||||
{
|
||||
local $/ = undef; my $file = <F>;
|
||||
$XSL_VERSION = $1 if $file =~ /VERSION.+\>(.+?)\</;
|
||||
}
|
||||
close F;
|
||||
my $download;
|
||||
if ($XSL_VERSION && $XSL_VERSION ne $XSL_VERSION_RECOMMENDED && ! $opt_myxsl) {
|
||||
print "\nUntested DocBook XSL found at $XSL.\n";
|
||||
print " Your version: $XSL_VERSION.\n";
|
||||
print " Recommended: $XSL_VERSION_RECOMMENDED.\n\n";
|
||||
print "Options at this point. Re-run with:\n";
|
||||
print " --myxsl to proceed with yours, or\n";
|
||||
print " --getxsl to install recommended XSL\n\n";
|
||||
exit 1;
|
||||
}
|
||||
if (! $XSL_VERSION) {
|
||||
print "\nDocBook XSL not found at $XSL.\n\nEither symlink that dir to the right ";
|
||||
print "place (preferrably at version $XSL_VERSION_RECOMMENDED),\nor re-run with --getxsl ";
|
||||
print "for me to do it for you.\n\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
chdir "$docraw_dir/build" or die;
|
||||
|
||||
print "Generating API reference\n";
|
||||
system("api/api2db.pl --exclude=BML:: --book=ljp > $docraw_dir/ljp.book/api/api.gen.xml")
|
||||
and die "Errror generating General API reference.\n";
|
||||
system("api/api2db.pl --include=BML:: --book=bml > $docraw_dir/bml.book/api.gen.xml")
|
||||
and die "Errror generating BML API reference.\n";
|
||||
|
||||
print "Generating DB Schema reference\n";
|
||||
chdir "$docraw_dir/build/db" or die;
|
||||
system("./dbschema.pl > dbschema.gen.xml")
|
||||
and die "Error generating DB schema\n";
|
||||
|
||||
my $err = system("xsltproc", "-o", "$docraw_dir/ljp.book/db/schema.gen.xml",
|
||||
"db2ref.xsl", "dbschema.gen.xml");
|
||||
if ($err == -1) { die "Error; Package 'xsltproc' not installed?\n"; }
|
||||
elsif ($err) { $err<<8; die "Error transforming DB schema. (error=$err)\n"; }
|
||||
|
||||
unlink "dbschema.gen.xml";
|
||||
|
||||
print "Generating XML-RPC protocol reference\n";
|
||||
chdir "$docraw_dir/build/protocol" or die;
|
||||
system("xsltproc", "-o", "$docraw_dir/ljp.book/csp/xml-rpc/protocol.gen.xml",
|
||||
"xml-rpc2db.xsl", "xmlrpc.xml")
|
||||
and die "Error processing protocol reference.\n";
|
||||
|
||||
print "Generating Flat protocol reference\n";
|
||||
system("./flat2db.pl > $docraw_dir/ljp.book/csp/flat/protocol.gen.xml")
|
||||
and die "Error processing protocol reference.\n";
|
||||
|
||||
print "Generating Log Prop List\n";
|
||||
system("./proplist2db.pl > $docraw_dir/ljp.book/csp/proplist.ref.gen.xml")
|
||||
and die "Error generating log prop list\n";
|
||||
|
||||
print "Generating Privilege list reference\n";
|
||||
chdir "$docraw_dir/build/priv" or die;
|
||||
system("./priv2db.pl > $docraw_dir/lj.book/admin/privs.ref.gen.xml")
|
||||
and die "Error generating privilege list\n";
|
||||
|
||||
print "Generating Console Command Reference\n";
|
||||
chdir "$docraw_dir/build/console" or die;
|
||||
system("./console2db.pl > $docraw_dir/lj.book/admin/console.ref.gen.xml")
|
||||
and die "Error generating console reference\n";
|
||||
|
||||
print "Generating Capability Class Reference\n";
|
||||
chdir "$docraw_dir/build/caps" or die;
|
||||
system("./cap2db.pl > $docraw_dir/lj.book/admin/cap.ref.gen.xml")
|
||||
and die "Error generating caps reference\n";
|
||||
system("./cap2db.pl > $docraw_dir/ljp.book/int/cap.ref.gen.xml")
|
||||
and die "Error generating caps reference\n";
|
||||
|
||||
print "Generating Hook Function Reference\n";
|
||||
chdir "$docraw_dir/build/hooks" or die;
|
||||
system("./hooks2db.pl > $docraw_dir/lj.book/customize/hooks.ref.gen.xml")
|
||||
and die "Error generating hooks reference\n";
|
||||
system("./hooks2db.pl > $docraw_dir/ljp.book/int/hooks.ref.gen.xml")
|
||||
and die "Error generating hooks reference\n";
|
||||
|
||||
print "Generating Configuration Variable Reference\n";
|
||||
chdir "$docraw_dir/build/ljconfig" or die;
|
||||
system("./ljconfig2db.pl > $docraw_dir/lj.book/install/ljconfig.vars.gen.xml")
|
||||
and die "Error generating ljconfig.pl variable reference\n";
|
||||
|
||||
print "Generating S1 Variable Reference\n";
|
||||
chdir "$docraw_dir/s1" or die;
|
||||
system("./s1ref2db.pl > $docraw_dir/ljp.book/styles/s1/ref.gen.xml")
|
||||
and die "Error generating s1 variable reference\n";
|
||||
|
||||
print "Generating Perl Module List\n";
|
||||
chdir "$docraw_dir/build/install" or die;
|
||||
system("./modulelist2db.pl > $docraw_dir/lj.book/install/perl.module.gen.xml")
|
||||
and die "Error generating perl module list\n";
|
||||
|
||||
print "Converting to HTML\n";
|
||||
mkdir $output_dir, 0755 unless -d $output_dir;
|
||||
chdir $output_dir or die "Couldn't chdir to $output_dir\n";
|
||||
|
||||
my $cssparam;
|
||||
if (-e "$docraw_dir/build/style.css") {
|
||||
$cssparam = "--stringparam html.stylesheet style.css";
|
||||
system("cp", "$docraw_dir/build/style.css", "$output_dir")
|
||||
and die "Error copying stylesheet.\n";
|
||||
}
|
||||
|
||||
system("xsltproc --nonet --catalogs $cssparam ".
|
||||
"$docraw_dir/build/chunk.xsl $docraw_dir/index.xml")
|
||||
and die "Error generating chunked HTML.\n";
|
||||
|
||||
if ($opt_single)
|
||||
{
|
||||
system("xsltproc --nonet --catalogs --output manual.html $cssparam ".
|
||||
"$docraw_dir/build/nochunk.xsl $docraw_dir/index.xml")
|
||||
and die "Error generating single HTML.\n";
|
||||
}
|
||||
|
||||
if ($opt_clean) {
|
||||
print "Removing Auto-generated files\n";
|
||||
system("find $docraw_dir -name '*.gen.*' -exec rm {} \;");
|
||||
}
|
||||
404
livejournal/doc/raw/build/hooks/hooks2db.pl
Executable file
404
livejournal/doc/raw/build/hooks/hooks2db.pl
Executable file
@@ -0,0 +1,404 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
unless (-d $ENV{'LJHOME'}) {
|
||||
die "\$LJHOME not set.\n";
|
||||
}
|
||||
|
||||
use vars qw(%hooks);
|
||||
|
||||
my $LJHOME = $ENV{'LJHOME'};
|
||||
|
||||
require "$LJHOME/doc/raw/build/docbooklib.pl";
|
||||
|
||||
$hooks{'canonicalize_url'} = {
|
||||
desc => "Cleans up a <abbrev>URL</abbrev> into its canonical form.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "<abbrev>URL</abbrev> to be cleaned",
|
||||
'name' => "\$url",
|
||||
}
|
||||
],
|
||||
source => ["bin/maint/stats.pl"],
|
||||
};
|
||||
|
||||
$hooks{'emailconfirmed'} = {
|
||||
desc => "After a user has confirmed their email address, this hook is called ".
|
||||
"with a dbs/dbh and a user object. This is useful to update a ".
|
||||
"database alias table which you also have your mail system using for ".
|
||||
"address lookups.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Either a dbs or dbh resource object.",
|
||||
'name' => "\$dbarg",
|
||||
},
|
||||
{
|
||||
'desc' => "User object.",
|
||||
'name' => "\$u",
|
||||
},
|
||||
],
|
||||
source => ["htdocs/register.bml"],
|
||||
};
|
||||
|
||||
$hooks{'login_formopts'} = {
|
||||
desc => "Returns extra <abbrev>HTML</abbrev> for login options on login.bml",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "Scalar return reference",
|
||||
'name' => "ret",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["htdocs/login.bml"],
|
||||
};
|
||||
|
||||
$hooks{'modify_login_menu'} = {
|
||||
desc => "Modifies or resets entirely the web menu data structure that is sent to the client.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "Menu item",
|
||||
'name' => "menu",
|
||||
},
|
||||
{
|
||||
'desc' => "User object",
|
||||
'name' => "u",
|
||||
},
|
||||
{
|
||||
'desc' => "Resource object",
|
||||
'name' => "dbs",
|
||||
},
|
||||
{
|
||||
'desc' => "Username string",
|
||||
'name' => "user",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["cgi-bin/ljprotocol.pl"],
|
||||
};
|
||||
|
||||
$hooks{'post_login'} = {
|
||||
desc => "Action to take after logging in, before HTML is sent to ".
|
||||
"to client (possible to print HTTP headers directly)",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "User object",
|
||||
'name' => "u",
|
||||
},
|
||||
{
|
||||
'desc' => "Hash of form elements",
|
||||
'name' => "form",
|
||||
},
|
||||
{
|
||||
'desc' => "Used for cookies. Can either be a unix timestamp, or '0' for session cookies.",
|
||||
'name' => "expiretime",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["htdocs/login.bml", "htdocs/talkread_do.bml"],
|
||||
};
|
||||
|
||||
$hooks{'post_changepassword'} = {
|
||||
desc => "Action to take after changing password, before HTML is sent to ".
|
||||
"to client (possible to print HTTP headers directly)",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "User object",
|
||||
'name' => "u",
|
||||
},
|
||||
{
|
||||
'desc' => "Resource object",
|
||||
'name' => "dbs",
|
||||
},
|
||||
{
|
||||
'desc' => "New password.",
|
||||
'name' => "newpassword",
|
||||
},
|
||||
{
|
||||
'desc' => "Old password.",
|
||||
'name' => "oldpassword",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["htdocs/changepassword.bml"],
|
||||
};
|
||||
|
||||
$hooks{'post_create'} = {
|
||||
desc => "Action to take after creating an account.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "Resource object",
|
||||
'name' => "dbs",
|
||||
},
|
||||
{
|
||||
'desc' => "Username string",
|
||||
'name' => "user",
|
||||
},
|
||||
{
|
||||
'desc' => "Integer",
|
||||
'name' => "userid",
|
||||
},
|
||||
{
|
||||
'desc' => "Auth code, if in use",
|
||||
'name' => "code",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["cgi-bin/ljlib.pl"],
|
||||
};
|
||||
|
||||
$hooks{'userinfo_html_by_user'} = {
|
||||
desc => "Extra <abbrev>HTML</abbrev> to show next to username & id on <filename>userinfo.bml</filename>",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "Scalar return reference",
|
||||
'name' => "ret",
|
||||
},
|
||||
{
|
||||
'desc' => "User object",
|
||||
'name' => "u",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["htdocs/userinfo.bml"],
|
||||
};
|
||||
|
||||
$hooks{'userinfo_rows'} = {
|
||||
desc => "Returns a two-element arrayref for a row on a userinfo page, ".
|
||||
"containing first the left side label, then the body.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "Resource Object (read-only)",
|
||||
'name' => "dbr",
|
||||
},
|
||||
{
|
||||
'desc' => "User object",
|
||||
'name' => "u",
|
||||
},
|
||||
{
|
||||
'desc' => "Remote user object",
|
||||
'name' => "remote",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["htdocs/userinfo.bml"],
|
||||
};
|
||||
|
||||
$hooks{'validate_get_remote'} = {
|
||||
desc => "This hook lets you ignore the remote user's cookies or flag them ".
|
||||
"as intentionally forged to LJ::get_remote(). If you return a ".
|
||||
"true value, no action is taken. If you return false, <function>LJ::get_remote()</function> ".
|
||||
"returns undef. You can optionally set <literal>\$\$criterr</literal> to something true as well.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Hash of arguments",
|
||||
'name' => "\%args",
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "May be an empty string or undef",
|
||||
'name' => "user",
|
||||
},
|
||||
{
|
||||
'desc' => "May be 0",
|
||||
'name' => "userid",
|
||||
},
|
||||
{
|
||||
'desc' => "Resource object",
|
||||
'name' => "dbs",
|
||||
},
|
||||
{
|
||||
'desc' => "Capabilities",
|
||||
'name' => "caps",
|
||||
},
|
||||
{
|
||||
'desc' => "Scalar error reference",
|
||||
'name' => "criterr",
|
||||
},
|
||||
{
|
||||
'desc' => "Sub reference which takes a cookie name and returns its value",
|
||||
'name' => "cookiesource",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["cgi-bin/ljlib.pl"],
|
||||
};
|
||||
|
||||
$hooks{'bad_password'} = {
|
||||
desc => "Check the given password, and either return a string explaining why ".
|
||||
"the password is bad, or undef if the password is ok.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Password to check",
|
||||
'name' => "\$password",
|
||||
},
|
||||
],
|
||||
source => ["cgi-bin/ljprotocol.pl","htdocs/changepassword.bml","htdocs/create.bml","htdocs/update.bml"],
|
||||
};
|
||||
|
||||
$hooks{'name_caps'} = {
|
||||
desc => "Returns the long name of the given capability bit.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Capability bit to check",
|
||||
'name' => "\$cap",
|
||||
},
|
||||
],
|
||||
source => ["cgi-bin/ljlib.pl"],
|
||||
};
|
||||
|
||||
$hooks{'name_caps_short'} = {
|
||||
desc => "Returns the short name of the given capability bit.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "Capability bit to check",
|
||||
'name' => "\$cap",
|
||||
},
|
||||
],
|
||||
source => ["cgi-bin/ljlib.pl"],
|
||||
};
|
||||
|
||||
$hooks{'login_add_opts'} = {
|
||||
desc => "Appends options to the cookie value. Each option should be short, and preceeded by a period.",
|
||||
args => [
|
||||
{
|
||||
'desc' => "",
|
||||
'name' => '%args',
|
||||
'keys' => [
|
||||
{
|
||||
'desc' => "User object",
|
||||
'name' => "u",
|
||||
},
|
||||
{
|
||||
'desc' => "Login form elements",
|
||||
'name' => "form",
|
||||
},
|
||||
{
|
||||
'desc' => "Hash reference of options to append to login cookie",
|
||||
'name' => "opts",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
source => ["htdocs/login.bml"],
|
||||
};
|
||||
|
||||
$hooks{'set_s2bml_lang'} = {
|
||||
desc => "Given an S2 Context, return the correct BML language id",
|
||||
args => [
|
||||
{
|
||||
'desc' => "S2 Context",
|
||||
'name' => '$ctx',
|
||||
},
|
||||
{
|
||||
'desc' => "Language id reference",
|
||||
'name' => '\$langref',
|
||||
},
|
||||
],
|
||||
source => ["cgi-bin/LJ/S2.pm"],
|
||||
};
|
||||
|
||||
sub hooks
|
||||
{
|
||||
my $hooks = shift;
|
||||
my $arg;
|
||||
print "<variablelist>\n";
|
||||
foreach my $hook (sort keys %$hooks)
|
||||
{
|
||||
print " <varlistentry>\n";
|
||||
print " <term><literal role=\"hook\">$hook</literal></term>\n";
|
||||
print " <listitem><formalpara><title>Synopsis:</title><para>\n";
|
||||
print " <funcsynopsis>\n";
|
||||
print " <funcprototype><funcdef><function>$hook</function></funcdef>\n";
|
||||
if (@{$hooks->{$hook}->{'args'}})
|
||||
{
|
||||
print " <paramdef>\n";
|
||||
foreach $arg (@{$hooks->{$hook}->{'args'}})
|
||||
{
|
||||
print " <parameter>$arg->{'name'}</parameter>\n";
|
||||
}
|
||||
print " </paramdef>\n";
|
||||
} else {
|
||||
print " <void/>";
|
||||
}
|
||||
print " </funcprototype>\n";
|
||||
print " </funcsynopsis>\n";
|
||||
print " $hooks->{$hook}->{'desc'}\n";
|
||||
print " </para></formalpara>\n";
|
||||
if (@{$hooks->{$hook}->{'args'}})
|
||||
{
|
||||
print " <formalpara><title>Arguments:</title><para>\n";
|
||||
print " <variablelist>\n";
|
||||
foreach $arg (@{$hooks->{$hook}->{'args'}})
|
||||
{
|
||||
print " <varlistentry>\n";
|
||||
print " <term><literal>$arg->{'name'}</literal></term>\n";
|
||||
print " <listitem>\n";
|
||||
print " <para>$arg->{'desc'}</para>\n";
|
||||
if ($arg->{'keys'})
|
||||
{
|
||||
print " <itemizedlist><title>Keys</title>\n";
|
||||
foreach my $key (@{$arg->{'keys'}})
|
||||
{
|
||||
print " <listitem><simpara><literal>$key->{'name'}</literal>";
|
||||
print " — $key->{'desc'}</simpara></listitem>\n";
|
||||
}
|
||||
print " </itemizedlist>";
|
||||
}
|
||||
print " </listitem>\n";
|
||||
print " </varlistentry>\n";
|
||||
}
|
||||
print " </variablelist>\n";
|
||||
print " </para></formalpara>\n";
|
||||
}
|
||||
print " <formalpara><title>Source:</title>\n";
|
||||
print " <para><itemizedlist>";
|
||||
foreach my $i ( 0 .. $#{ $hooks->{$hook}->{'source'} } ) {
|
||||
print "<listitem><simpara><filename>";
|
||||
print $hooks->{$hook}->{'source'}[$i];
|
||||
print "</filename></simpara></listitem>";
|
||||
}
|
||||
print " </itemizedlist></para></formalpara>\n";
|
||||
print " </listitem>\n";
|
||||
print " </varlistentry>\n";
|
||||
}
|
||||
print "</variablelist>\n";
|
||||
}
|
||||
|
||||
hooks(\%hooks);
|
||||
112
livejournal/doc/raw/build/install/modulelist2db.pl
Executable file
112
livejournal/doc/raw/build/install/modulelist2db.pl
Executable file
@@ -0,0 +1,112 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
unless (-d $ENV{'LJHOME'}) {
|
||||
die "\$LJHOME not set.\n";
|
||||
}
|
||||
|
||||
my $LJHOME = $ENV{'LJHOME'};
|
||||
my (%modules, @debs, $line);
|
||||
require "$LJHOME/doc/raw/build/docbooklib.pl";
|
||||
require "$LJHOME/cgi-bin/ljlib.pl";
|
||||
|
||||
my @modules;
|
||||
my $indoc; my $curmod;
|
||||
open (CFG, "$LJHOME/bin/checkconfig.pl") or return 0;
|
||||
while ($line = <CFG>)
|
||||
{
|
||||
$line = LJ::trim($line);
|
||||
next if $line =~ /^\},/;
|
||||
if ($line =~ /\Qmy %modules\E/) { $indoc = 1; next; }
|
||||
if ($indoc && $line =~ /\Q);\E/) { $indoc = 0; next; }
|
||||
if ($indoc) {
|
||||
if ($line =~ /^\"(.+?)\"/) {
|
||||
push @modules, $curmod if $curmod->{'name'};
|
||||
$curmod = {};
|
||||
$curmod->{'name'} = $1;
|
||||
}
|
||||
if ($line =~ /\'deb\' \=> \'(.+?)\'/) { $curmod->{'deb'} = $1; }
|
||||
if ($line =~ /^\'opt\' \=> [\'\"](.+?)[\'\"]/) { $curmod->{'opt'} = $1; }
|
||||
} elsif ($curmod->{'name'}) {
|
||||
push @modules, $curmod if $curmod->{'name'};
|
||||
$curmod = {};
|
||||
}
|
||||
}
|
||||
close CFG;
|
||||
|
||||
# Print reference
|
||||
|
||||
print "<table frame='none'>\n <title>Required Modules</title>\n";
|
||||
print " <tgroup cols='2'>\n <tbody>\n";
|
||||
foreach my $module ( @modules )
|
||||
{
|
||||
print " <row><entry>$module->{'name'}</entry><entry>$module->{'deb'}</entry></row>\n" unless $module->{'opt'};
|
||||
}
|
||||
print " </tbody>\n </tgroup>\n</table>";
|
||||
print "<variablelist>\n <title>Optional modules</title>\n";
|
||||
foreach my $module ( @modules )
|
||||
{
|
||||
print " <varlistentry><term>$module->{'name'}</term><term>$module->{'deb'}</term><listitem><simpara>$module->{'opt'}</simpara></listitem></varlistentry>\n" if $module->{'opt'};
|
||||
}
|
||||
print "</variablelist>";
|
||||
|
||||
print "<formalpara><title>Debian Install</title><para>";
|
||||
print "If you're using Debian the following command should retrieve and build every required module:</para></formalpara>";
|
||||
print "<screen><prompt>#</prompt> <userinput>apt-get install ";
|
||||
my $i = 0;
|
||||
foreach my $module ( @modules ) {
|
||||
next if $module->{'opt'};
|
||||
if ($i == 3) { print "\\\n"; $i = 0; } $i++;
|
||||
print "$module->{'deb'} ";
|
||||
}
|
||||
print "</userinput></screen>
|
||||
|
||||
<simpara>And likewise for the optional modules:</simpara>
|
||||
|
||||
<screen><prompt>#</prompt> <userinput>apt-get install ";
|
||||
$i = 0;
|
||||
foreach my $module ( @modules ) {
|
||||
next unless $module->{'opt'};
|
||||
if ($i == 3) { print "\\\n"; $i = 0; } $i++;
|
||||
print "$module->{'deb'} ";
|
||||
}
|
||||
|
||||
print "</userinput></screen>
|
||||
|
||||
<formalpara>
|
||||
<title>Using CPAN</title>
|
||||
<para>
|
||||
Otherwise you'll want to use CPAN to install the modules by performing the following steps:
|
||||
</para>
|
||||
</formalpara>
|
||||
<simpara>From the root prompt on your server, invoke the CPAN shell:</simpara>
|
||||
<screen><prompt>#</prompt> <userinput>perl -MCPAN -e shell</userinput></screen>
|
||||
|
||||
<simpara>
|
||||
Once the Perl interpreter has loaded (and been configured), you can install
|
||||
modules by issuing the command <literal>install <replaceable>MODULENAME</replaceable></literal>.
|
||||
</simpara>
|
||||
<simpara>The first thing you should do is upgrade your CPAN:</simpara>
|
||||
|
||||
<screen><prompt>cpan></prompt> <userinput>install Bundle::CPAN</userinput></screen>
|
||||
|
||||
<simpara>Once it's done, type:</simpara>
|
||||
|
||||
<screen><prompt>cpan></prompt> <userinput>reload cpan</userinput></screen>
|
||||
|
||||
<simpara>Now, enter the following command to retrieve all of the required modules:</simpara>
|
||||
|
||||
<screen>";
|
||||
foreach my $module ( @modules ) {
|
||||
print "<prompt>cpan></prompt> <userinput>install $module->{'name'}</userinput>\n" unless $module->{'opt'};
|
||||
}
|
||||
print "</screen>
|
||||
<simpara>And likewise for the optional modules:</simpara>
|
||||
|
||||
<screen>";
|
||||
foreach my $module ( @modules ) {
|
||||
print "<prompt>cpan></prompt> <userinput>install $module->{'name'}</userinput>\n" if $module->{'opt'};
|
||||
}
|
||||
print "</screen>";
|
||||
488
livejournal/doc/raw/build/ljconfig/ljconfig2db.pl
Executable file
488
livejournal/doc/raw/build/ljconfig/ljconfig2db.pl
Executable file
@@ -0,0 +1,488 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
unless (-d $ENV{'LJHOME'}) {
|
||||
die "\$LJHOME not set.\n";
|
||||
}
|
||||
|
||||
my $LJHOME = $ENV{'LJHOME'};
|
||||
require "$LJHOME/doc/raw/build/docbooklib.pl";
|
||||
|
||||
my %ljconfig =
|
||||
(
|
||||
'user' => {
|
||||
'name' => 'User-Configurable',
|
||||
'desc' => "New installations will probably want to set these variables. Some are ".
|
||||
"automatically set by ljdefaults.pl based on your other settings, but it ".
|
||||
"wouldn't hurt to specify them all explicitly.",
|
||||
|
||||
'domain' => {
|
||||
'name' => 'Domain Related',
|
||||
'sitename' => {
|
||||
'desc' => "The name of the site",
|
||||
},
|
||||
'sitenameshort' => {
|
||||
'desc' => "The shortened name of the site, for brevity purposes.",
|
||||
'default' => "LiveJournal",
|
||||
},
|
||||
'sitenameabbrev' => {
|
||||
'desc' => "The abbreviated version of the name of the site.",
|
||||
'default' => "LJ",
|
||||
},
|
||||
'siteroot' => {
|
||||
'desc' => "The URL prefix to construct canonical pages. This can include the port number, if 80 is not in use.",
|
||||
'default' => "http://www.\$DOMAIN:8011/",
|
||||
},
|
||||
'imgprefix' => {
|
||||
'desc' => "The URL prefix of the image directory or subdomain.",
|
||||
'default' => '$SITEROOT/img',
|
||||
},
|
||||
'statprefix' => {
|
||||
'desc' => "The URL prefix to the static content directory or subdomain.",
|
||||
'default' => '$SITEROOT/stc',
|
||||
},
|
||||
'userpic_root' => {
|
||||
'desc' => "The URL prefix to the userpic directory or subdomain.",
|
||||
'default' => '$SITEROOT/userpic',
|
||||
},
|
||||
'domain' => {
|
||||
'desc' => "The minimal domain of the site, excluding the 'www.' prefix if applicable.",
|
||||
},
|
||||
'domain_web' => {
|
||||
'desc' => "Optional. If defined and different from [ljconfig[domain]], any GET requests to [ljconfig[domain]] will be redirected to [ljconfig[domain_web]].",
|
||||
},
|
||||
'cookie_domain' => {
|
||||
'desc' => "Cookie domains should simply be set to .\$domain.com, based on the Netscape Cookie Spec, ".
|
||||
"but some older browsers don't adhere to the specs too well. [ljconfig[cookie_domain]] can ".
|
||||
"be a single string value, or it can be a perl array ref.",
|
||||
'example' => '["", ".$DOMAIN"]',
|
||||
'default' => ".\$DOMAIN",
|
||||
},
|
||||
#'cookie_path' => {
|
||||
# 'desc' => "According to the RFCs concerning cookies, the cookie path needs to be explicitly set as well. If LiveJournal is installed ".
|
||||
# "underneath a directory other than the top level domain directory, this needs to be set accordingly.",
|
||||
# 'default' => "/",
|
||||
#},
|
||||
'server_name' => {
|
||||
'desc' => "Optional. If using db-based web logging, this field is stored in the database in the server column, so you can see later how well each server performed. ".
|
||||
"To share the same ljconfig.pl on each host (say, over NFS), you can put something like this in your ljconfig.pl: It's kinda ugly, but it works. ",
|
||||
'example' => 'chomp($SERVER_NAME = `hostname`);',
|
||||
},
|
||||
'frontpage_journal' => {
|
||||
'desc' => "If set, the main page of the site loads the specified journal, not the default index page. ".
|
||||
"Use this if you're running a news site where there's only one journal, or one journal is dominant.",
|
||||
},
|
||||
'tos_check' => {
|
||||
'desc' => "If set, the account creation dialog shows a checkbox, asking users if they agree to the site's Terms of Service, ".
|
||||
"and won't allow them to create an account if they refuse. This depends on a few files being located in the proper directories, ".
|
||||
"namely <filename>tos.bml</filename> and <filename>tos-mini.bml</filename> under <filename><envar>\$LJHOME</envar>/htdocs/legal/</filename>. ".
|
||||
"The account creation dialog can also check for new instances of the Terms of Service if the Terms of Service text is located in a ".
|
||||
"CVS managed include file (<filename><envar>\$LJHOME</envar>/htdocs/inc/legal-tos</filename>), ".
|
||||
"and if the include file includes the following line at the top: <programlisting><![CDATA[<!-- \$Revision\$ -->]]></programlisting>",
|
||||
},
|
||||
'coppa_check' => {
|
||||
'desc' => "If set, the account creation dialog shows a checkbox, asking users if they're under 13 years old and won't let them create an account if they check it.",
|
||||
},
|
||||
},
|
||||
|
||||
'database' => {
|
||||
'name' => "Database Related",
|
||||
'dbinfo' => {
|
||||
'desc' => "This is a hash that contains the necessary information to connect to your database, as well as ".
|
||||
"the configuration for multiple database clusters, if your installation supports them. ".
|
||||
"Consult [special[dbinfo]] for more details.",
|
||||
'type' => "hash",
|
||||
},
|
||||
'clusters' => {
|
||||
'default' => "(1)",
|
||||
'desc' => "This is an array that contains the names of the clusters that your configuration uses.",
|
||||
'example' => 'qw(fast slow)',
|
||||
'type' => "array",
|
||||
},
|
||||
'default_cluster' => {
|
||||
'desc' => "The default cluster to choose when creating new accounts.",
|
||||
'default' => "1",
|
||||
},
|
||||
'dir_db' => {
|
||||
'desc' => "This setting tells the installation which database to read from for directory usage. ".
|
||||
"By default this is left blank, meaning that it will use the main database. This can make larger installations work much slower.",
|
||||
},
|
||||
'dir_db_host' => {
|
||||
'desc' => "The database role to use when connecting to the directory database.",
|
||||
'example' => "master",
|
||||
},
|
||||
},
|
||||
|
||||
'system_tools' => {
|
||||
'name' => "System Tools",
|
||||
'sendmail' => {
|
||||
'desc' => "The system path to the sendmail program, along with any necessary parameters.",
|
||||
'example' => '"/usr/bin/sendmail -t"',
|
||||
},
|
||||
'speller' => {
|
||||
'desc' => "The system path to a spell checking binary, along with any necessary parameters.",
|
||||
'example' => '"/usr/local/bin/aspell pipe --sug-mode=fast --ignore-case"',
|
||||
},
|
||||
'smtp_server' => {
|
||||
'desc' => "This the recommended system to use for sending email. This requires the perl Net::SMTP module to work properly.",
|
||||
'example' => "10.2.0.1",
|
||||
},
|
||||
},
|
||||
|
||||
'optimizations' => {
|
||||
'name' => "Optimization",
|
||||
'max_hints_lastn' => {
|
||||
'desc' => "Sets how many entries a user can have on their <literal>LASTN</literal> page. A higher value can majorly affect the speed of the installation.",
|
||||
'default' => "100",
|
||||
},
|
||||
'max_scrollback_friends' => {
|
||||
'desc' => "Sets how far back someone can go on a user's <literal>FRIENDS</literal> page. A higher value can majorly affect the speed of the installation.",
|
||||
'default' => "1000",
|
||||
},
|
||||
'use_recent_tables' => {
|
||||
'desc' => "Only turn this on if you are using MySQL replication between multiple databases and have one or more slaves set to not ".
|
||||
"replicated the logtext and talktext tables. Turning this on makes LJ duplicate all logtext & talktext rows into ".
|
||||
"recent_logtext & recent_talktext which is then replicated. However, a cron job cleans up that table so it's never too big. ".
|
||||
"LJ will try the slaves first, then the master. This is the best method of scaling your LJ installation, as disk seeks on the ".
|
||||
"database for journal text is the slowest part.",
|
||||
},
|
||||
'do_gzip' => {
|
||||
'desc' => "Boolean setting that when enabled, signals to the installation to use gzip encoding wherever possible. In most cases this is known ".
|
||||
"to cut bandwidth usage in half. Requires the Compress::Zlib perl module.",
|
||||
},
|
||||
'msg_readonly_user' => {
|
||||
'desc' => "Message to send to users if their account becomes readonly during maintenance.",
|
||||
'example' => "This journal is in read-only mode right now while database maintenance is being performed. Try again in a few minutes.",
|
||||
},
|
||||
'compress_text' => {
|
||||
'desc' => "Boolean setting that compresses log and comment text in the database, to save disk space.",
|
||||
}
|
||||
},
|
||||
|
||||
'syndication' => {
|
||||
'name' => "Syndicated Account Options",
|
||||
'syn_lastn_s1' => {
|
||||
'desc' => "When set to an appropriate <literal>LASTN</literal> style, all syndicated accounts on this installation will use this style.",
|
||||
},
|
||||
'synd_cluster' => {
|
||||
'desc' => "Syndicated accounts tend to have more database traffic than normal accounts, so its a good idea to set up a seperate cluster for them.".
|
||||
"If set to a cluster (defined by [ljconfig[clusters]]), all newly created syndicated accounts will reside on that cluster.",
|
||||
},
|
||||
},
|
||||
|
||||
'debug' => {
|
||||
'name' => "Development/Debugging Options",
|
||||
'allow_cluster_select' => {
|
||||
'desc' => "When set true, the journal creation page will display a drop-down list of clusters (from [ljconfig[clusters]]) along ".
|
||||
"with the old 'cluster 0' which used the old db schema and the user creating an account can choose where they go. ".
|
||||
"In reality, there's no use for this, it's only useful when working on the code.",
|
||||
},
|
||||
'nodb_msg' => {
|
||||
'desc' => "Message to send to users when the database is unavailable",
|
||||
'default' => "Database temporarily unavailable. Try again shortly.",
|
||||
},
|
||||
'server_down' => {
|
||||
'desc' => "Set true when performing maintenance that requires user activity to be minimum, such as database defragmentation and cluster movements.",
|
||||
'default' => "0",
|
||||
},
|
||||
'server_down_subject' => {
|
||||
'desc' => "While [ljconfig[server_down]] is set true, a message with this subject is displayed for anyone trying to access the LiveJournal installation.",
|
||||
'example' => "Maintenance",
|
||||
},
|
||||
'server_down_message' => {
|
||||
'desc' => "While [ljconfig[server_down]] is set true, this message will be displayed for anyone trying to access the LiveJournal installation.",
|
||||
'example' => '$SITENAME is down right now while we upgrade. It should be up in a few minutes.',
|
||||
},
|
||||
'is_dev_server' => {
|
||||
'desc' => "Enable this option to signify that the server running the LiveJournal software is being used as a development server.",
|
||||
},
|
||||
},
|
||||
|
||||
'email_addresses' => {
|
||||
'name' => "Contact email addresses",
|
||||
'admin_email' => {
|
||||
'desc' => "Given as the administrative address for functions like changing passwords or information.",
|
||||
},
|
||||
'support_email' => {
|
||||
'desc' => "Used as a contact method for people to report problems with the LiveJournal installation.",
|
||||
},
|
||||
'bogus_email' => {
|
||||
'desc' => "Used for automated notices like comment replies and general support request messages. It should be encouraged <emphasis>not</emphasis> to reply to this address.",
|
||||
},
|
||||
},
|
||||
|
||||
'caps' => {
|
||||
'name' => "Capabilities/User Options",
|
||||
'newuser_caps' => {
|
||||
'desc' => "The default capability class mask for new users.",
|
||||
},
|
||||
'cap_def' => {
|
||||
'desc' => "The default capability limits, used only when no other class-specific limit below matches.",
|
||||
'type' => "hash",
|
||||
},
|
||||
'cap' => {
|
||||
'desc' => "A hash that defines the capability class limits. The keys are bit numbers, from 0 .. 15, and the values ".
|
||||
"are hashrefs with limit names and values. Consult [special[cabalities]] for more information.",
|
||||
'type' => "hash",
|
||||
},
|
||||
'user_email' => {
|
||||
'desc' => "Do certain users get a forwarding email address, such as user\@\$DOMAIN?. This requires additional mail system configuration.",
|
||||
},
|
||||
'user_vhosts' => {
|
||||
'desc' => "If enabled, the LiveJournal installation will support username URLs of the form http://username.yoursite.com/",
|
||||
},
|
||||
'user_domain' => {
|
||||
'desc' => "If [ljconfig[user_vhosts]] is enabled, this will is the part of the URL that follows 'username'.",
|
||||
'example' => '$DOMAIN',
|
||||
},
|
||||
'email_post_domain' => {
|
||||
'desc' => "If set, and your MTA is configured, users can post to their account via username@\$EMAIL_POST_DOMAIN.",
|
||||
'example' => 'post.$DOMAIN',
|
||||
},
|
||||
'default_style' => {
|
||||
'desc' => "A hash that defines the default S2 layers to use for accounts.",
|
||||
'default' => "{
|
||||
'core' => 'core1',
|
||||
'layout' => 'generator/layout',
|
||||
'i18n' => 'generator/en',
|
||||
};",
|
||||
},
|
||||
'allow_pics_over_quota' => {
|
||||
'desc' => "By default, when a user's account expires, their least often used userpics will get marked ".
|
||||
"as inactive and will not be available for use. Turning this boolean setting true will circumvent this behavior.",
|
||||
},
|
||||
'userprop_def' => {
|
||||
'desc' => "This option defines the userproperties that users should have by default.",
|
||||
'type' => "hash",
|
||||
'example' => '%USERPROP_DEF = (
|
||||
"s1_lastn_style" => 29,
|
||||
"s1_friends_style" => 20,
|
||||
"s1_calendar_style" => 2,
|
||||
"s1_day_style" => 11,
|
||||
);',
|
||||
},
|
||||
},
|
||||
'misc' => {
|
||||
'name' => "Miscellaneous settings",
|
||||
'helpurls' => {
|
||||
'desc' => "A hash of URLs. If defined, little help bubbles appear next to common widgets to the URL you define. ".
|
||||
"Consult [special[helpurls]] for more information.",
|
||||
'example' => '%HELPURLS = (
|
||||
"accounttype" => "http://www.example.com/doc/faq/",
|
||||
"security" => "http://www.example.com/doc/security",
|
||||
);',
|
||||
'type' => "hash",
|
||||
},
|
||||
'use_acct_codes' => {
|
||||
'desc' => "A boolean setting that makes the LiveJournal installation require an invitation code before anyone can create an account.".
|
||||
"Consult [special[invitecodes]] for more information.",
|
||||
},
|
||||
'disabled' => {
|
||||
'desc' => "Boolean hash, signifying that separate parts of this LiveJournal installation are working and are avaiable to use. ".
|
||||
"Consult [special[disabled]] for more information.",
|
||||
'type' => "hash",
|
||||
},
|
||||
'protected_usernames' => {
|
||||
'desc' => "This is a list of regular expressions matching usernames that users on this LiveJournal installation can't create on their own.",
|
||||
'type' => "array",
|
||||
'example' => '("^ex_", "^lj_")',
|
||||
},
|
||||
'initial_friends' => {
|
||||
'desc' => "This is a list of usernames that will be added to the friends list of all newly created accounts on this installation.",
|
||||
'type' => "array",
|
||||
'example' => "qw(news)",
|
||||
},
|
||||
'testaccts' => {
|
||||
'desc' => "A list of usernames used for testing purposes. The password to these accounts cannot be changed through the user interface.",
|
||||
'type' => "array",
|
||||
'example' => "qw(test test2);",
|
||||
},
|
||||
'no_password_check' => {
|
||||
'desc' => "Set this option true if you are running an installation using ljcom code and if you haven't installed the Crypt::Cracklib perl module.",
|
||||
},
|
||||
'schemes' => {
|
||||
'desc' => "An array of hashes with keys being a BML scheme name and the values being the scheme description. When set, users can change their ".
|
||||
"default BML scheme to the scheme of their choice.",
|
||||
'type' => "array",
|
||||
'example' => "(
|
||||
{ scheme => 'bluewhite', title => 'Blue White' },
|
||||
{ scheme => 'lynx', title => 'Lynx' },
|
||||
{ scheme => 'opalcat', title => 'Opalcat' },
|
||||
);",
|
||||
},
|
||||
'force_empty_friends' => {
|
||||
'desc' => "A hash of userids whose friends views should be disabled for performance reasons. This is useful if new accounts are auto-added to ".
|
||||
"another account upon creation (described in [ljconfig[initial_friends]]), as in most situations building a friends view for those ".
|
||||
"accounts would be superflous and taxing on your installation.",
|
||||
'type' => "hash",
|
||||
'example' => "(
|
||||
234 => 1,
|
||||
232252 => 1,
|
||||
);",
|
||||
},
|
||||
'anti_squatter' => {
|
||||
'desc' => "Set true if your installation is a publically available development server and if you would like ".
|
||||
"beta testers to ensure that they understand as such. If left alone your installation might become susceptible to ".
|
||||
"hordes of squatter accounts.",
|
||||
},
|
||||
's2_trusted' => {
|
||||
'desc' => "Allows a specific user's S2 layers to run javascript, something that is considered a potential security risk and is disabled for all accounts. The hash structure is a series of userid => username pairs. Note that the system account is trusted by default, so it is not necessary to add to this hash.",
|
||||
'type' => "hash",
|
||||
'example' => "( '2' => 'whitaker', '3' => 'test', );",
|
||||
},
|
||||
'dynamic_ljuser' => {
|
||||
'desc' => "Boolean variable that defines whether the user-types of users is looked up when [func[LJ::ljuser]] is called. This is not recommended unless the site is using memcached.",
|
||||
},
|
||||
'hide_friendof_via_ban' => {
|
||||
'desc' => "Allows a user to hide usernames from appearing on their 'friend-of' list via use of the 'ban' mechanism.",
|
||||
},
|
||||
},
|
||||
|
||||
'portal' => {
|
||||
'name' => "Portal Configuration",
|
||||
'portal_cols' => {
|
||||
'desc' => 'This is a list that specifies which columns can be used for the portal pages.',
|
||||
'type' => 'array',
|
||||
'default' => 'qw(main right moz)',
|
||||
},
|
||||
'portal_uri' => {
|
||||
'desc' => "The URI to the portal. Only two options are supported at this time, '/portal/' and '/'.",
|
||||
'default' => "/portal/",
|
||||
},
|
||||
'portal_logged_in' => {
|
||||
'desc' => "The default positions for portal boxes that a user will see when they are logged in.",
|
||||
'default' => "{'main' => [
|
||||
[ 'update', 'mode=full'],
|
||||
],
|
||||
'right' => [
|
||||
[ 'stats', '', ],
|
||||
[ 'bdays', '', ],
|
||||
[ 'popfaq', '', ],
|
||||
] };",
|
||||
},
|
||||
'portal_logged_out' => {
|
||||
'desc' => "The default positions for portal boxes that a user will see when they are logged out.",
|
||||
'default' => "{'main' => [
|
||||
[ 'update', 'mode='],
|
||||
],
|
||||
'right' => [
|
||||
[ 'login', '', ],
|
||||
[ 'stats', '', ],
|
||||
[ 'randuser', '', ],
|
||||
[ 'popfaq', '', ],
|
||||
],
|
||||
'moz' => [
|
||||
[ 'login', '', ],
|
||||
],
|
||||
};",
|
||||
},
|
||||
},
|
||||
'blob' => {
|
||||
'name' => "Blob Server",
|
||||
'blobinfo' => {
|
||||
'desc' => "Hash that contains the details for a number of blob servers. The format of the paramater is 'cluster' => 'director'. The webserver user also needs to be able to the directory given as the directory. If you wish to use Captcha Image and Audio Generation for Human Checks, then this is a necessary paramater",
|
||||
'type' => "hash",
|
||||
'example' => '%BLOBINFO = (
|
||||
"clusters" => {
|
||||
"1" => "/path/to/some/directory/",
|
||||
},
|
||||
);'
|
||||
},
|
||||
'userpric_blobserver' => {
|
||||
'desc' => "If set to true, userpics are store as a file on the server rather than in the database. This depends on a Blob Server being setup in the [ljconfig[blobinfo]] section",
|
||||
},
|
||||
},
|
||||
'captcha' => {
|
||||
'name' => "Human Checks",
|
||||
'human_check' => {
|
||||
'desc' => 'This option enables human checks at various places throughout the site. Enabling this requires a "Blob Server" setup (for details of setting one up, refer to the [ljconfig[blobinfo]] section of the document.) Currently, the only option is "create"',
|
||||
'type' => "hash",
|
||||
'example' => "('create' => 1);",
|
||||
},
|
||||
},
|
||||
},
|
||||
'auto' => {
|
||||
'name' => 'Auto-Configured',
|
||||
'desc' => "These <varname>\$LJ::</varname> settings are automatically set in ".
|
||||
"<filename>ljdefaults.pl</filename>. They're only documented here for ".
|
||||
"people interested in extending LiveJournal. Or, you can define them in ".
|
||||
"<filename>ljconfig.pl</filename> ahead of time so you can use them in ".
|
||||
"definitions of future variables. ",
|
||||
|
||||
'directories' => {
|
||||
'name' => "Configuration Directories",
|
||||
'home' => {
|
||||
'desc' => "Set to the same value as [special[ljhome]]",
|
||||
'default' => "\$ENV{'LJHOME'}",
|
||||
},
|
||||
'htdocs' => {
|
||||
'desc' => "Points to the htdocs directory under [special[ljhome]]",
|
||||
'default' => "\$HOME/htdocs",
|
||||
},
|
||||
'bin' => {
|
||||
'desc' => "Points to the under bin directory under [special[ljhome]]",
|
||||
'default' => "\$HOME/bin",
|
||||
},
|
||||
'temp' => {
|
||||
'desc' => "Points to the temp directory under [special[ljhome]]",
|
||||
'default' => "\$HOME/temp",
|
||||
},
|
||||
'var' => {
|
||||
'desc' => "Points to the var directory under [special[ljhome]]",
|
||||
'default' => "\$HOME/var",
|
||||
},
|
||||
},
|
||||
|
||||
'i18n' => {
|
||||
'name' => "Internationalization",
|
||||
'unicode' => {
|
||||
'desc' => "Boolean setting that allows UTF-8 support. This is enabled by default.",
|
||||
},
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
for my $type ( keys %ljconfig )
|
||||
{
|
||||
print " <section id='lj.install.ljconfig.vars.$type'>\n";
|
||||
print " <title>" . %ljconfig->{$type}->{'name'} . "</title>\n";
|
||||
print " <simpara>" . %ljconfig->{$type}->{'desc'} . "</simpara>\n";
|
||||
for my $list ( sort keys %{%ljconfig->{$type}} ) {
|
||||
next if ($list eq "name" || $list eq "desc");
|
||||
print " <variablelist>\n";
|
||||
print " <title>" . %ljconfig->{$type}->{$list}->{'name'} . "</title>\n";
|
||||
foreach my $var ( sort keys %{%ljconfig->{$type}->{$list}} ) {
|
||||
next if $var eq "name";
|
||||
my $vartype = '$';
|
||||
if (%ljconfig->{$type}->{$list}->{$var}->{'type'} eq "hash") { $vartype = '%'; }
|
||||
if (%ljconfig->{$type}->{$list}->{$var}->{'type'} eq "array") { $vartype = '@'; }
|
||||
print " <varlistentry id='ljconfig.$var'>\n";
|
||||
print " <term><varname role='ljconfig.variable'>" . $vartype . "LJ::" . uc($var) . "</varname></term>\n";
|
||||
my $des = %ljconfig->{$type}->{$list}->{$var}->{'desc'};
|
||||
$des =~ s/&(?!(?:[a-zA-Z0-9]+|#\d+);)/&/g;
|
||||
xlinkify(\$des);
|
||||
print " <listitem><simpara>$des</simpara>\n";
|
||||
if (%ljconfig->{$type}->{$list}->{$var}->{'example'})
|
||||
{
|
||||
print " <para><emphasis>Example:</emphasis> ";
|
||||
print "<informalexample><programlisting>";
|
||||
print %ljconfig->{$type}->{$list}->{$var}->{'example'};
|
||||
print "</programlisting></informalexample></para>\n";
|
||||
}
|
||||
if (%ljconfig->{$type}->{$list}->{$var}->{'default'})
|
||||
{
|
||||
print " <para><emphasis>Default:</emphasis> ";
|
||||
print "<informalexample><programlisting>";
|
||||
print %ljconfig->{$type}->{$list}->{$var}->{'default'};
|
||||
print "</programlisting></informalexample></para>\n";
|
||||
}
|
||||
print " </listitem>\n";
|
||||
print " </varlistentry>\n";
|
||||
}
|
||||
print " </variablelist>\n";
|
||||
}
|
||||
print " </section>\n";
|
||||
}
|
||||
|
||||
#hooks();
|
||||
141
livejournal/doc/raw/build/ljdocs2html.xsl
Executable file
141
livejournal/doc/raw/build/ljdocs2html.xsl
Executable file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:import href="xsl-docbook/html/chunk.xsl"/>
|
||||
|
||||
<xsl:include href="titlepage.xsl"/>
|
||||
|
||||
<!-- canonical URL support -->
|
||||
<xsl:param name="use.id.as.filename" select="1"/>
|
||||
|
||||
<!-- More inline with perl style docs -->
|
||||
<xsl:param name="funcsynopsis.style" select="ansi"/>
|
||||
|
||||
<!-- Label sections -->
|
||||
<xsl:param name="section.autolabel" select="1"/>
|
||||
|
||||
<xsl:param name="local.l10n.xml" select="document('')"/>
|
||||
|
||||
<xsl:param name="toc.section.depth">2</xsl:param>
|
||||
|
||||
<xsl:param name="chunk.section.depth" select="1"/>
|
||||
|
||||
<xsl:param name="chunk.first.sections" select="1"/>
|
||||
|
||||
<xsl:param name="navig.showtitles">1</xsl:param>
|
||||
|
||||
<xsl:param name="html.cleanup" select="1"/>
|
||||
|
||||
<xsl:param name="refentry.generate.title" select="1"/>
|
||||
|
||||
<xsl:param name="refentry.generate.name" select="0"/>
|
||||
|
||||
<xsl:template name="anchor">
|
||||
<xsl:param name="node" select="."/>
|
||||
<xsl:param name="conditional" select="1"/>
|
||||
<xsl:variable name="id">
|
||||
<xsl:call-template name="object.id">
|
||||
<xsl:with-param name="object" select="$node"/>
|
||||
</xsl:call-template>
|
||||
</xsl:variable>
|
||||
<!-- Only write a self referring link if there is an explicit id -->
|
||||
<xsl:if test="$node/@id">
|
||||
<a class="linkhere" href="#{$id}">»</a> <a name="{$id}"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="question">
|
||||
<xsl:variable name="deflabel">
|
||||
<xsl:choose>
|
||||
<xsl:when test="ancestor-or-self::*[@defaultlabel]">
|
||||
<xsl:value-of select="(ancestor-or-self::*[@defaultlabel])[last()]
|
||||
/@defaultlabel"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="qanda.defaultlabel"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<tr class="{name(.)}">
|
||||
<td align="left" valign="top">
|
||||
<xsl:call-template name="anchor">
|
||||
<xsl:with-param name="node" select=".."/>
|
||||
<xsl:with-param name="conditional" select="0"/>
|
||||
</xsl:call-template>
|
||||
<!-- Why do they call this twice?
|
||||
<xsl:call-template name="anchor">
|
||||
<xsl:with-param name="conditional" select="0"/>
|
||||
</xsl:call-template> -->
|
||||
|
||||
<b>
|
||||
<xsl:apply-templates select="." mode="label.markup"/>
|
||||
<xsl:text>. </xsl:text> <!-- FIXME: Hack!!! This should be in the locale! -->
|
||||
</b>
|
||||
</td>
|
||||
<td align="left" valign="top">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$deflabel = 'none' and not(label)">
|
||||
<b><xsl:apply-templates select="*[name(.) != 'label']"/></b>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates select="*[name(.) != 'label']"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
</tr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ulink" name="ulink">
|
||||
<xsl:variable name="link">
|
||||
<a>
|
||||
<xsl:if test="@id">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:value-of select="@id"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
|
||||
<xsl:if test="$ulink.target != ''">
|
||||
<xsl:attribute name="target">
|
||||
<xsl:value-of select="$ulink.target"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(child::node())=0">
|
||||
<xsl:value-of select="@url"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<span class="ulink"> <img src="/img/globe.gif" alt="[o]" />»</span>
|
||||
</a>
|
||||
</xsl:variable>
|
||||
<xsl:copy-of select="$link"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="guibutton">
|
||||
<span class="guibutton">
|
||||
<xsl:call-template name="inline.charseq"/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="guilabel">
|
||||
<span class="guilabel">
|
||||
<xsl:call-template name="inline.charseq"/>
|
||||
</span>
|
||||
</xsl:template>
|
||||
|
||||
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
|
||||
<l:l10n language="en">
|
||||
<l:context name="xref">
|
||||
<l:template name="chapter" text="Chapter %n: %t"/>
|
||||
</l:context>
|
||||
<l:context name="section-xref-numbered">
|
||||
<l:template name="section" text="Section %n: %t"/>
|
||||
</l:context>
|
||||
</l:l10n>
|
||||
</l:i18n>
|
||||
|
||||
</xsl:stylesheet>
|
||||
11
livejournal/doc/raw/build/nochunk.xsl
Executable file
11
livejournal/doc/raw/build/nochunk.xsl
Executable file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<!-- This file is kind of lame, but necessary -->
|
||||
|
||||
<xsl:import href="xsl-docbook/html/docbook.xsl"/>
|
||||
|
||||
<xsl:include href="ljdocs2html.xsl"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
53
livejournal/doc/raw/build/priv/priv2db.pl
Executable file
53
livejournal/doc/raw/build/priv/priv2db.pl
Executable file
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
unless (-d $ENV{'LJHOME'}) {
|
||||
die "\$LJHOME not set.\n";
|
||||
}
|
||||
|
||||
require "$ENV{'LJHOME'}/doc/raw/build/docbooklib.pl";
|
||||
require "$ENV{'LJHOME'}/cgi-bin/ljlib.pl";
|
||||
|
||||
my $dbr = LJ::get_dbh("slave", "master");
|
||||
my $sth;
|
||||
|
||||
sub dump_privs
|
||||
{
|
||||
my $privs = shift;
|
||||
|
||||
print "<variablelist>\n <title>User Privileges</title>\n";
|
||||
foreach my $priv (sort keys %$privs)
|
||||
{
|
||||
|
||||
my ($des, $args) = split(/arg=/, $privs->{$priv}->{'des'});
|
||||
my $scope = $privs->{$priv}->{'scope'};
|
||||
|
||||
print "<varlistentry>\n";
|
||||
print "<term><literal role=\"priv\">$priv</literal>";
|
||||
print " -- (scope: $scope)" if $scope eq "local";
|
||||
print "</term>\n";
|
||||
|
||||
print "<listitem><formalpara>\n";
|
||||
print "<title>$privs->{$priv}->{'name'}</title>\n";
|
||||
cleanse(\$des);
|
||||
print "<para>$des</para>\n";
|
||||
|
||||
print "<para><emphasis>Argument:</emphasis> $args</para>\n" if $args;
|
||||
print "</formalpara></listitem>\n";
|
||||
|
||||
print "</varlistentry>\n";
|
||||
}
|
||||
print "</variablelist>\n";
|
||||
}
|
||||
|
||||
my %privs;
|
||||
|
||||
$sth = $dbr->prepare("SELECT * FROM priv_list");
|
||||
$sth->execute;
|
||||
while (my ($prlid, $privcode, $privname, $des, $is_public, $scope) = $sth->fetchrow_array) {
|
||||
$privs{$privcode} = { 'public' => $is_public, 'name' => $privname, 'des' => $des, 'scope' => $scope};
|
||||
}
|
||||
|
||||
dump_privs(\%privs);
|
||||
36
livejournal/doc/raw/build/protocol/authinfo.ent.xml
Executable file
36
livejournal/doc/raw/build/protocol/authinfo.ent.xml
Executable file
@@ -0,0 +1,36 @@
|
||||
<key name="username" count="1">
|
||||
<scalar><des>
|
||||
Username of user logging in.
|
||||
</des></scalar>
|
||||
</key>
|
||||
<key name="auth_method" count="opt">
|
||||
<scalar><des>
|
||||
Authentication method used for this request. The default value is "clear", for plain-text authentication. "cookie" and any of the challenge / response methods are also acceptable.
|
||||
</des></scalar>
|
||||
</key>
|
||||
<key name="password" count="opt">
|
||||
<scalar><des>
|
||||
DEPRECATED. Password of user logging in in plaintext. If using the "clear" authentication method, either this or "hpassword" must be present.
|
||||
</des></scalar>
|
||||
</key>
|
||||
<key name="hpassword" count="opt">
|
||||
<scalar><des>
|
||||
DEPRECATED. MD5 digest of user's password. Not much more secure than password, but at least it's not in plain text.
|
||||
</des></scalar>
|
||||
</key>
|
||||
<key name="auth_challenge" count="opt">
|
||||
<scalar><des>
|
||||
If using challenge / response authentication, this should be the challenge that was issued to you by the server.
|
||||
</des></scalar>
|
||||
</key>
|
||||
<key name="auth_response" count="opt">
|
||||
<scalar><des>
|
||||
If using challenge / response authentication, this should be the response hash that you generate, based on the formula required for your challenge.
|
||||
</des></scalar>
|
||||
</key>
|
||||
<key name="ver" count="opt">
|
||||
<scalar><des>
|
||||
Protocol version supported by the client; assumed to be 0 if not specified. See <link id="ljp.csp.versions" /> for details on the protocol version
|
||||
</des></scalar>
|
||||
</key>
|
||||
|
||||
109
livejournal/doc/raw/build/protocol/checkfriends.mode.xml
Executable file
109
livejournal/doc/raw/build/protocol/checkfriends.mode.xml
Executable file
@@ -0,0 +1,109 @@
|
||||
<method name="checkfriends">
|
||||
<shortdes>
|
||||
Checks to see if your friends list has been updated since a specified time.
|
||||
</shortdes>
|
||||
<des>
|
||||
Mode that clients can use to poll the server to see if their friends list has been updated. This request is extremely quick, and is the preferred way for users to see when their friends list is updated, rather than pounding on reload in their browser, which is stressful on the serves.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="lastupdate" count="1"><scalar><des>
|
||||
The time that this mode request returned last time you called it. If this is the first time you've ever called it (since your client has been running), leave this blank. It's strongly recommended that you do not remember this value across invocations of your client, as it's very likely your friends will update since the client was running so the notification is pointless... the user probably read his/her friends page already before starting the client.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="mask" count="opt"><scalar><des>
|
||||
The friend group(s) in which the client is checking for new entries, represented as a 32-bit unsigned int. Turn on any combination of bits 1-30 to check for entries by friends in the respective friend groups. Turn on bit 0, or leave the mask off entirely, to check for entries by any friends.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 481
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.checkfriends</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>lastupdate</name>
|
||||
<value><string></string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="new"><scalar><des>
|
||||
This is what you should use to determine if there are new entries. Its value is "1" if there is new stuff, or "0" if there isn't. Note that once this values becomes "1" and you alert the user, <emphasis>stop polling!</emphasis> It'd be pointless to have the client hitting the server all night while the user slept. Once the user acknowleges the notifcation (double-clicks the system tray or panel applet or whatnot), then resume your polling.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="interval"><scalar><des>
|
||||
How many seconds you <emphasis>must</emphasis> wait before polling the server again. If your client disobeys, this protocol will just return error messages saying "slow down, bad client!" instead of giving you the data you were trying to cheat to obtain. Note that this also means your client should have an option to disable polling for updates, since some users run multiple operating systems with multiple LiveJournal clients, and both would be fighting each other.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="count" count="1"><scalar><des>
|
||||
The number of items that are contained in this response (numbered started at 1). If sync_count is equal to sync_total, then you can stop your sync after you complete fetching every item in this response.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="total" count="1"><scalar><des>
|
||||
The total number of items that have been updated since the time specified.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 358
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 22:49:07 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>lastupdate</name>
|
||||
<value><string>2002-07-16 14:22:16</string></value>
|
||||
</member>
|
||||
<member><name>new</name>
|
||||
|
||||
<value><int>0</int></value>
|
||||
</member>
|
||||
<member><name>interval</name>
|
||||
<value><int>90</int></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
176
livejournal/doc/raw/build/protocol/consolecommand.mode.xml
Executable file
176
livejournal/doc/raw/build/protocol/consolecommand.mode.xml
Executable file
@@ -0,0 +1,176 @@
|
||||
<method name="consolecommand">
|
||||
<shortdes>
|
||||
Run an administrative command.
|
||||
</shortdes>
|
||||
<des>
|
||||
The LiveJournal server has a text-based shell-like admininistration
|
||||
console where less-often used commands can be entered. There's a web
|
||||
interface to this shell online, and this is another gateway to that.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="commands" count="1"><list count="1">
|
||||
<scalar count="0more"><des>
|
||||
The commands to send, with double quotes around any arguments with spaces,
|
||||
and double quotes escaped by backslashes, and backslashes escaped with
|
||||
backslashes. Optionally, you can send a listref instead of a string
|
||||
for this argument, in which case, we'll use your argument separation
|
||||
and not parse it ourselves.
|
||||
</des></scalar>
|
||||
</list></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 542
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.consolecommand</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>commands</name>
|
||||
<value><array>
|
||||
<data>
|
||||
<value><string>help print</string></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="results" count="1">
|
||||
<list count="1"><des>
|
||||
One stuct returned for each command run,
|
||||
that struct containing both the overall return value,
|
||||
and the line-by-line output of the command, with
|
||||
each line of output being tagged by type (think
|
||||
stdout vs. stderr, but with stdinfo also). The web interface
|
||||
shows 'error' with red, '' (stdout) with black, and 'info'
|
||||
with green. Clients are encouraged to also, if possible.
|
||||
</des>
|
||||
<struct count="0more">
|
||||
<key name="success" count="1">
|
||||
<scalar><des>
|
||||
Return status of nth command. 0 or 1.
|
||||
</des></scalar>
|
||||
</key>
|
||||
<key name="output" count="1">
|
||||
<list count="1">
|
||||
<scalar count="1"><des>
|
||||
Type of output line. Either "" (normal output), "error", or "info",
|
||||
something to be emphasized over normal output.
|
||||
</des></scalar>
|
||||
<scalar count="1"><des>
|
||||
The text of that line.
|
||||
</des></scalar>
|
||||
</list>
|
||||
</key>
|
||||
</struct>
|
||||
</list>
|
||||
</key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 1189
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 22:59:33 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>results</name>
|
||||
|
||||
<value><array>
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>success</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>output</name>
|
||||
<value><array>
|
||||
<data>
|
||||
<value><array>
|
||||
<data>
|
||||
|
||||
<value><string></string></value>
|
||||
<value><string>print ...</string></value>
|
||||
</data>
|
||||
</array></value>
|
||||
<value><array>
|
||||
|
||||
<data>
|
||||
<value><string></string></value>
|
||||
<value><string> This is a debugging function. Given an arbitrary number of</string></value>
|
||||
</data>
|
||||
</array></value>
|
||||
|
||||
<value><array>
|
||||
<data>
|
||||
<value><string></string></value>
|
||||
<value><string> meaningless arguments, it'll print each one back to you. If an</string></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
<value><array>
|
||||
<data>
|
||||
<value><string></string></value>
|
||||
<value><string> argument begins with a bang (!) then it'll be printed to the error</string></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
<value><array>
|
||||
<data>
|
||||
<value><string></string></value>
|
||||
<value><string> stream instead.</string></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</data>
|
||||
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
184
livejournal/doc/raw/build/protocol/editevent.mode.xml
Executable file
184
livejournal/doc/raw/build/protocol/editevent.mode.xml
Executable file
@@ -0,0 +1,184 @@
|
||||
<method name="editevent">
|
||||
<shortdes>
|
||||
Edit or delete a user's past journal entry
|
||||
</shortdes>
|
||||
<des>
|
||||
Modify an already created event. If fields are empty, it will delete the event.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="itemid" count="1"><scalar><des>
|
||||
The unique ItemID of the item being modified or deleted.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="event" count="1"><scalar><des>
|
||||
The revised event/log text the user is submitting. Or, to delete an entry, just send no text at all. Carriage returns are okay (0x0A, 0x0A0D, or 0x0D0A), although 0x0D are removed internally to make everything into Unix-style line-endings (just \ns). Posts may also contain HTML, but be aware that the LiveJournal server converts newlines to HTML <BR>s when displaying them, so your client should not try to insert these itself.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="lineendings" count="1"><scalar><des>
|
||||
Specifies the type of line-endings you're using. Possible values are <emphasis>unix</emphasis> (0x0A (\n)), <emphasis>pc</emphasis> (0x0D0A (\r\n)), or <emphasis>mac</emphasis> (
|
||||
0x0D (\r) ). The default is not-Mac. Internally, LiveJournal stores all text as Unix-form
|
||||
atted text, and it does the conversion by removing all \r characters. If you're sending a
|
||||
multi-line event on Mac, you have to be sure and send a lineendings value of mac or you
|
||||
r line endings will be removed. PC and Unix clients can ignore this setting, or you can s
|
||||
end it. It may be used for something more in the future.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="subject" count="1"><scalar><des>
|
||||
The subject for this post. Limited to 255 characters. No newlines.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="security" count="opt"><scalar><des>
|
||||
Specifies who can read this post. Valid values are <emphasis>public</emphasis> (default), <emphasis>private</emphasis> and <emphasis>usemask</emphasis>. When value is usemask, viewability is controlled by the allowmask.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="allowmask" count="opt"><scalar><des>
|
||||
Relevant when security is usemask. A 32-bit unsigned integer representing which of the user's groups of friends are allowed to view this post. Turn bit 0 on to allow any defined friend to read it. Otherwise, turn bit 1-30 on for every friend group that should be allowed to read it. Bit 31 is reserved.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="props" count="opt">
|
||||
<des>
|
||||
Set arbitrary (but restricted) meta-data properties to this log item. See <link id="ljp.csp.proplist" />
|
||||
for the documentation of the keys and value data types.
|
||||
</des>
|
||||
<list count="1">
|
||||
<des>The following 'struct' should have property names as the keys, and the values should be a scalar data type.</des>
|
||||
<struct count="0more"/>
|
||||
</list>
|
||||
</key>
|
||||
|
||||
<key name="usejournal" count="opt"><scalar><des>
|
||||
If editing a shared journal entry, include this key and the username you wish to edit the entry in. By default, you edit the entry as if it were in user "user"'s journal, as specified above.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="year" count="1"><scalar><des>
|
||||
If modifying only, the 4-digit year of the event (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="mon" count="1"><scalar><des>
|
||||
If modifying only, the 1- or 2-digit month of the event (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="day" count="1"><scalar><des>
|
||||
If modifying only, the 1- or 2-digit day of the month of the event (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="hour" count="1"><scalar><des>
|
||||
If modifying only, the 1- or 2-digit hour from 0 to 23 of the event (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="min" count="1"><scalar><des>
|
||||
If modifying only, the 1- or 2-digit minute of the event (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 1032
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.editevent</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>itemid</name>
|
||||
<value><int>1959</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>event</name>
|
||||
<value><string>This &lt;strike&gt;is&lt;/strike&gt; was a test post.
|
||||
</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>subject</name>
|
||||
<value><string>Test</string></value>
|
||||
</member>
|
||||
<member><name>lineendings</name>
|
||||
|
||||
<value><string>pc</string></value>
|
||||
</member>
|
||||
<member><name>year</name>
|
||||
<value><int>2002</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>mon</name>
|
||||
<value><int>7</int></value>
|
||||
</member>
|
||||
<member><name>day</name>
|
||||
|
||||
<value><int>13</int></value>
|
||||
</member>
|
||||
<member><name>hour</name>
|
||||
<value><int>20</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>min</name>
|
||||
<value><int>35</int></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="itemid" count="1"><scalar><des>
|
||||
The unique ItemID of the item being modified or deleted.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="anum" count="1"><scalar><des>
|
||||
The authentication number generated for this entry. It can be used by the client to generate URLs, but that is not recommended. (See the returned 'url' element if you want to link to a post.)
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="url" count="1"><scalar><des>
|
||||
The permanent link address to this post. This is an opaque string--you should store it as is. While it will generally follow a predictable pattern, there is no guarantee of any particular format for these, and it may change in the future.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 267
|
||||
Content-Type: text/xml
|
||||
Date: Sat, 13 Jul 2002 23:57:17 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>anum</name>
|
||||
<value><int>141</int></value>
|
||||
</member>
|
||||
<member><name>itemid</name>
|
||||
|
||||
<value><int>1959</int></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
119
livejournal/doc/raw/build/protocol/editfriendgroups.mode.xml
Executable file
119
livejournal/doc/raw/build/protocol/editfriendgroups.mode.xml
Executable file
@@ -0,0 +1,119 @@
|
||||
<method name="editfriendgroups">
|
||||
<shortdes>
|
||||
Edit the user's defined groups of friends.
|
||||
</shortdes>
|
||||
<des>
|
||||
Given several optional lists, will add/delete/update/rename the friends groups for a user.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="groupmasks" count="opt"><struct count="1">
|
||||
<des>
|
||||
A structure of friend userids. The values of each are a string representing an unsigned 32-bit integer with bit 0 set (or the server will force it on anyway), bits 1-30 set for each group the friend belongs to, and bit 31 unset (reserved for future use).
|
||||
</des>
|
||||
</struct></key>
|
||||
|
||||
<key name="set" count="opt"><struct count="1">
|
||||
<des>
|
||||
Given the bit of a friend group, the value contains a structure of information on it.
|
||||
</des>
|
||||
<struct count="0more">
|
||||
<key name="name" count="1"><scalar><des>
|
||||
Create or rename the friend group by sending this key. The value is the name of the group.
|
||||
</des></scalar></key>
|
||||
<key name="sort" count="opt"><scalar><des>
|
||||
This field should be sent to indicate the sorting order of this group. The value must be in the range of 0-255. The default is 50.
|
||||
</des></scalar></key>
|
||||
<key name="public" count="opt"><scalar><des>
|
||||
If this is "1", then this group is marked as public. If public, other users can see the name of the group and the people that are in it.
|
||||
</des></scalar></key>
|
||||
</struct>
|
||||
</struct></key>
|
||||
|
||||
<key name="delete" count="opt"><list count="1"><scalar count="0more"><des>
|
||||
A number of a friend group to delete (which can be from 1-30, inclusive). The server will modify all old entries that allow access to that friend group, so a new friend group using that number won't have access to old non-related entries, and unset the bit for that friend group on the groupmask of each friend, unless your client sends the friend's new groupmask explicitly.
|
||||
</des></scalar></list></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 780
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.editfriendgroups</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>set</name>
|
||||
<value><struct>
|
||||
<member><name>1</name>
|
||||
<value><struct>
|
||||
|
||||
<member><name>name</name>
|
||||
<value><string>Good Friends</string></value>
|
||||
</member>
|
||||
<member><name>sort</name>
|
||||
|
||||
<value><int>25</int></value>
|
||||
</member>
|
||||
<member><name>public</name>
|
||||
<value><boolean>1</boolean></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 132
|
||||
Content-Type: text/xml
|
||||
Date: Mon, 15 Jul 2002 23:16:33 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
147
livejournal/doc/raw/build/protocol/editfriends.mode.xml
Executable file
147
livejournal/doc/raw/build/protocol/editfriends.mode.xml
Executable file
@@ -0,0 +1,147 @@
|
||||
<method name="editfriends">
|
||||
<shortdes>
|
||||
Add, edit, or delete friends from the user's friends list.
|
||||
</shortdes>
|
||||
<des>
|
||||
Takes up to two lists, one of friends to delete and one of friends to add. Several options are allowed to be specified when adding a friend. It returns a verbose list of the friends added, if any were.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="delete" count="opt"><list count="1">
|
||||
<des>
|
||||
A list of variable of this form removes the friend users from the user's friend list. It is not an error to delete an already non-existant friend. The value should just be 1.
|
||||
</des>
|
||||
<scalar count="0more"><des>
|
||||
A username of a friend to remove.
|
||||
</des></scalar>
|
||||
</list></key>
|
||||
|
||||
<key name="add" count="opt"><list count="1">
|
||||
<des>
|
||||
To add friends, send a variable list of this form.
|
||||
</des>
|
||||
<struct count="0more">
|
||||
<key name="username" count="1"><scalar><des>
|
||||
A username of a friend to remove.
|
||||
</des></scalar></key>
|
||||
<key name="fgcolor" count="opt"><scalar><des>
|
||||
Sets the text color of the friend being added. This value is a HTML-style hex-triplet, and must either be of the form <emphasis>#rrggbb</emphasis> or not sent at all. By default, the value assumed is #000000, black.
|
||||
</des></scalar></key>
|
||||
<key name="bgcolor" count="opt"><scalar><des>
|
||||
Sets the background color of the friend being added. This value is a HTML-style hex-triplet, and must either be of the form <emphasis>#rrggbb</emphasis> or not sent at all. By default, the value assumed is #FFFFFF, white.
|
||||
</des></scalar></key>
|
||||
<key name="groupmask" count="opt"><scalar><des>
|
||||
Sets this user's groupmask. Only use this in clients if you've very recently loaded the friend groups. If your client has been loaded on the end user's desktop for days and you haven't loaded friend groups since it started, they may be inaccurate if they've modified their friend groups through the website or another client. In general, don't use this key unless you know what you're doing.
|
||||
</des></scalar></key>
|
||||
</struct>
|
||||
</list></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 774
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.editfriends</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>add</name>
|
||||
<value><array>
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
|
||||
<value><string>bradfitz</string></value>
|
||||
</member>
|
||||
<member><name>fgcolor</name>
|
||||
<value><string>#000000</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>bgcolor</name>
|
||||
<value><string>#ffffff</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="added" count="opt"><des>
|
||||
A list of the users who have been added with this transaction.
|
||||
</des>
|
||||
<list count="1"><struct count="0more">
|
||||
<key name="username"><scalar><des>
|
||||
The username of the friend that was added.
|
||||
</des></scalar></key>
|
||||
<key name="fullname"><scalar><des>
|
||||
The full name of the friend that was added.
|
||||
</des></scalar></key>
|
||||
</struct></list></key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 420
|
||||
Content-Type: text/xml
|
||||
Date: Mon, 15 Jul 2002 23:52:18 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>added</name>
|
||||
|
||||
<value><array>
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>bradfitz</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>fullname</name>
|
||||
<value><string>Brad Fitzpatrick</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
64
livejournal/doc/raw/build/protocol/flat2db.pl
Executable file
64
livejournal/doc/raw/build/protocol/flat2db.pl
Executable file
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
unless (-d $ENV{'LJHOME'}) { die "\$LJHOME not set.\n"; }
|
||||
|
||||
require "$ENV{'LJHOME'}/doc/raw/build/docbooklib.pl";
|
||||
require "$ENV{'LJHOME'}/cgi-bin/propparse.pl";
|
||||
|
||||
my @vars;
|
||||
LJ::load_objects_from_file("$ENV{'LJHOME'}/htdocs/protocol.dat", \@vars);
|
||||
|
||||
foreach my $mode (sort { $a->{'name'} cmp $b->{'name'} } @vars)
|
||||
{
|
||||
my $name = $mode->{'name'};
|
||||
my $des = $mode->{'props'}->{'des'};
|
||||
cleanse(\$des);
|
||||
|
||||
unshift (@{$mode->{'props'}->{'request'}},
|
||||
{ 'name' => "mode", 'props' => { 'des' => "The protocol request mode: <tt>$name</tt>", } },
|
||||
{ 'name' => "user", 'props' => { 'des' => "Username. Leading and trailing whitespace is ignored, as is case.", } },
|
||||
{ 'name' => "auth_method", 'props' => { 'des' => "The authentication method used for this request. Default is 'clear', for plain-text authentication. 'cookie' or any of the challenge / response methods are also acceptable.", } },
|
||||
{ 'name' => "password", 'props' => { 'des' => "DEPRECATED. Password in plain-text. For the default authentication method, either this needs to be sent, or <tt>hpassword</tt>.", } },
|
||||
{ 'name' => "hpassword", 'props' => { 'des' => "DEPRECATED. Alternative to plain-text <tt>password</tt>. Password as an MD5 hex digest. Not perfectly secure, but defeats the most simple of network sniffers.", } },
|
||||
{ 'name' => "auth_challenge", 'props' => { 'des' => "If using challenge / response authentication, this should be the challenge that was generated for your client.", } },
|
||||
{ 'name' => "auth_response", 'props' => { 'des' => "If using challenge / response authentication, this should be the response hash you generate based on the challenge's formula.", } },
|
||||
{ 'name' => "ver", 'props' => { 'des' => "Protocol version supported by the client; assumed to be 0 if not specified. See [special[cspversion]] for details on the protocol version.", 'optional' => 1, } },
|
||||
) unless $name eq "getchallenge";
|
||||
unshift (@{$mode->{'props'}->{'response'}},
|
||||
{ 'name' => "success", 'props' => { 'des' => "<b><tt>OK</tt></b> on success or <b><tt>FAIL</tt></b> when there's an error. When there's an error, see <tt>errmsg</tt> for the error text. The absence of this variable should also be considered an error.", } },
|
||||
{ 'name' => "errmsg", 'props' => { 'des' => "The error message if <tt>success</tt> was <tt>FAIL</tt>, not present if <tt>OK</tt>. If the success variable isn't present, this variable most likely won't be either (in the case of a server error), and clients should just report \"Server Error, try again later.\".", } },
|
||||
);
|
||||
print "<refentry id=\"ljp.csp.flat.$name\">\n";
|
||||
print " <refnamediv>\n <refname>$name</refname>\n";
|
||||
print " <refpurpose>$des</refpurpose>\n </refnamediv>\n";
|
||||
|
||||
print " <refsect1>\n <title>Mode Description</title>\n";
|
||||
print " <para>$des</para>\n </refsect1>\n";
|
||||
foreach my $rr (qw(request response))
|
||||
{
|
||||
print "<refsect1>\n";
|
||||
my $title = $rr eq "request" ? "Arguments" : "Return Values";
|
||||
print " <title>$title</title>\n";
|
||||
print " <variablelist>\n";
|
||||
foreach (@{$mode->{'props'}->{$rr}})
|
||||
{
|
||||
print " <varlistentry>\n";
|
||||
cleanse(\$_->{'name'});
|
||||
print " <term><literal>$_->{'name'}</literal></term>\n";
|
||||
print " <listitem><para>\n";
|
||||
if ($_->{'props'}->{'optional'}) {
|
||||
print "<emphasis>(Optional)</emphasis>\n";
|
||||
}
|
||||
cleanse(\$_->{'props'}->{'des'});
|
||||
print "$_->{'props'}->{'des'}\n";
|
||||
print " </para></listitem>\n";
|
||||
print " </varlistentry>\n";
|
||||
}
|
||||
print " </variablelist>\n";
|
||||
print "</refsect1>\n";
|
||||
}
|
||||
print "</refentry>\n";
|
||||
}
|
||||
21
livejournal/doc/raw/build/protocol/friendgroups.ent.xml
Executable file
21
livejournal/doc/raw/build/protocol/friendgroups.ent.xml
Executable file
@@ -0,0 +1,21 @@
|
||||
<list count="1">
|
||||
<struct count="0more">
|
||||
|
||||
<key name="id" count="1"><scalar><des>
|
||||
The bit number for this friend group, from 1-30.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="name" count="1"><scalar><des>
|
||||
The name of this friend group.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="sortorder" count="1"><scalar><des>
|
||||
The sort integer for this friend group, from 0-255.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="public" count="1"><scalar><des>
|
||||
Either '0' or '1' for if this friend group is public.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct>
|
||||
</list>
|
||||
122
livejournal/doc/raw/build/protocol/friendof.mode.xml
Executable file
122
livejournal/doc/raw/build/protocol/friendof.mode.xml
Executable file
@@ -0,0 +1,122 @@
|
||||
<method name="friendof">
|
||||
<shortdes>
|
||||
Returns a list of which other LiveJournal users list this user as their friend.
|
||||
</shortdes>
|
||||
<des>
|
||||
Returns a "friends of" list for a specified user. An optional limit of returned friends can be supplied.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="friendoflimit" count="opt"><scalar><des>
|
||||
If set to a numeric value greater than zero, this mode will only return the number of results indicated. Useful only for building pretty lists for display which might have a button to view the full list nearby.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 475
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.friendof</methodName>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
<member><name>friendoflimit</name>
|
||||
<value><int>2</int></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="friendofs" count="1">
|
||||
<des>
|
||||
The list of people who list this user as a friend.
|
||||
</des>
|
||||
&friendsList;
|
||||
</key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 936
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 00:53:15 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>friendofs</name>
|
||||
<value><array>
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>fgcolor</name>
|
||||
|
||||
<value><string>#000000</string></value>
|
||||
</member>
|
||||
<member><name>username</name>
|
||||
<value><string>aisha_plushie</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>fullname</name>
|
||||
<value><string>Stripe</string></value>
|
||||
</member>
|
||||
<member><name>bgcolor</name>
|
||||
|
||||
<value><string>#ffffff</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>fgcolor</name>
|
||||
|
||||
<value><string>#000000</string></value>
|
||||
</member>
|
||||
<member><name>username</name>
|
||||
<value><string>badcharlotte</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>fullname</name>
|
||||
<value><string>Charlotte</string></value>
|
||||
</member>
|
||||
<member><name>bgcolor</name>
|
||||
|
||||
<value><string>#ffffff</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
29
livejournal/doc/raw/build/protocol/friendslist.ent.xml
Executable file
29
livejournal/doc/raw/build/protocol/friendslist.ent.xml
Executable file
@@ -0,0 +1,29 @@
|
||||
<list count="1">
|
||||
<struct count="0more">
|
||||
|
||||
<key name="username" count="1"><scalar><des>
|
||||
The username of the friend.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="fullname" count="1"><scalar><des>
|
||||
The full name of the friend.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="type" count="opt"><scalar><des>
|
||||
The type of journal the friend item is. This value can be one of 'community', 'syndicated', 'news', or 'shared', depending on the journaltype of the account in question. The account is a normal personal account when this value is not sent.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="fgcolor" count="1"><scalar><des>
|
||||
The foreground color of the friend item.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="bgcolor" count="1"><scalar><des>
|
||||
The background color of the friend item.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="groupmask" count="1"><scalar><des>
|
||||
If the group mask is not "1" (just bit 0 set), then this variable is returned with an 32-bit unsigned integer with a bit 0 always set, and bits 1-30 set for each group this friend is a part of. Bit 31 is reserved.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct>
|
||||
</list>
|
||||
81
livejournal/doc/raw/build/protocol/getchallenge.mode.xml
Executable file
81
livejournal/doc/raw/build/protocol/getchallenge.mode.xml
Executable file
@@ -0,0 +1,81 @@
|
||||
<method name="getchallenge">
|
||||
<shortdes>
|
||||
Generate a server challenge string for authentication.
|
||||
</shortdes>
|
||||
<des>
|
||||
Generate a one-time, quick expiration challenge to be used in challenge/response authentication methods.
|
||||
</des>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 97
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.getchallenge</methodName>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="auth_scheme" count="1"><scalar><des>
|
||||
You can ignore this for now. By default this is the highest version of our
|
||||
authentication schemes, if in the future if we implement other auth schemes or change the default.
|
||||
In that case we'd add a new capabilities exchange: your client could say, "I know c0 and c1", and
|
||||
our server would then say, "Use c1, it's the best."
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="challenge" count="1"><scalar><des>
|
||||
An opaque cookie to generate a hashed response from.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="expire_time" count="1"><scalar><des>
|
||||
The expiration time of the challenge, as measured in seconds since the Unix epoch.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="server_time" count="1"><scalar><des>
|
||||
The server time when the challenge was generated, as measured in seconds since the Unix epoch.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 557
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 00:30:01 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>auth_scheme</name>
|
||||
<value><string>c0</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>challenge</name>
|
||||
<value><string>c0:1073113200:2831:60:2TCbFBYR72f2jhVDuowz:0fba728f5964ea54160a5b18317d92df</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>expire_time</name>
|
||||
<value><int>1073116091</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>server_time</name>
|
||||
<value><int>1073116031</int></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
143
livejournal/doc/raw/build/protocol/getdaycounts.mode.xml
Executable file
143
livejournal/doc/raw/build/protocol/getdaycounts.mode.xml
Executable file
@@ -0,0 +1,143 @@
|
||||
<method name="getdaycounts">
|
||||
<shortdes>
|
||||
This mode retrieves the number of journal entries per day.
|
||||
</shortdes>
|
||||
<des>
|
||||
This mode retrieves the number of journal entries per day. Useful for populating calendar widgets in GUI clients. Optionally a journal can be specified. It returns a list of the dates and accompanied counts.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="usejournal" count="opt">
|
||||
<des>
|
||||
If getting the day counts of a shared journal, include this key and the username you wish to get the counts of. By default, you load the counts of "user" as specified above.
|
||||
</des>
|
||||
&useJournal;
|
||||
</key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 403
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.getdaycounts</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="daycounts" count="1"><list count="1"><struct count="0more"><des>
|
||||
For each day that the user has posted a journal entry, a struct is returned in the list.
|
||||
</des>
|
||||
<key name="date"><scalar><des>The date, in yyyy-dd-mm format.</des></scalar></key>
|
||||
<key name="count"><scalar><des>The number of journal entries on that date.</des></scalar></key>
|
||||
</struct>
|
||||
</list></key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 70580
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 20:50:28 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>daycounts</name>
|
||||
<value><array>
|
||||
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>count</name>
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
|
||||
<member><name>date</name>
|
||||
<value><string>1995-05-01</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
|
||||
<member><name>count</name>
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
<member><name>date</name>
|
||||
|
||||
<value><string>1997-05-01</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>count</name>
|
||||
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
<member><name>date</name>
|
||||
<value><string>1999-05-03</string></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>count</name>
|
||||
<value><int>17</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>date</name>
|
||||
<value><string>1999-05-04</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
...
|
||||
|
||||
<value><struct>
|
||||
<member><name>count</name>
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
<member><name>date</name>
|
||||
|
||||
<value><string>2020-02-20</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
235
livejournal/doc/raw/build/protocol/getevents.mode.xml
Executable file
235
livejournal/doc/raw/build/protocol/getevents.mode.xml
Executable file
@@ -0,0 +1,235 @@
|
||||
<method name="getevents">
|
||||
<shortdes>
|
||||
Download parts of the user's journal.
|
||||
</shortdes>
|
||||
<des>
|
||||
Given a set of specifications, will return a segment of entries up to a limit set by the server. Has a set of options for less, extra, or special data to be returned.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="truncate" count="opt"><scalar><des>
|
||||
A value that if greater than or equal to 4, truncates the length of the returned events (after being decoded) to the value specified. Entries less than or equal to this length are left untouched. Values greater than this length are truncated to the specified length minus 3, and then have "... " appended to them, bringing the total length back up to what you specified. This is good for populating list boxes where only the beginning of the entry is important, and you'll double-click it to bring up the full entry.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="prefersubject" count="opt"><scalar><des>
|
||||
If this setting is set to true (1 ), then no subjects are returned, and the events are actually subjects if they exist, or if not, then they're the real events. This is useful when clients display history and need to give the user something to double-click. The subject is shorter and often more informative, so it'd be best to download only this.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="noprops" count="opt"><scalar><des>
|
||||
If this setting is set to true (1), then no meta-data properties are returned.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="selecttype" count="1"><scalar><des>
|
||||
Determines how you want to specify what part of the journal to download. Valid values are <emphasis>day</emphasis> to download one entire day, <emphasis>lastn</emphasis> to get the most recent n entries (where n is specified in the howmany field), <emphasis>one</emphasis> to download just one specific entry, or <emphasis>syncitems</emphasis> to get some number of items (which the server decides) that have changed since a given time (specified in the lastsync parameter>). Not that because the server decides what items to send, you may or may not be getting everything that's changed. You should use the syncitems selecttype in conjuntions with the syncitems protocol mode.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="lastsync" count="opt"><scalar><des>
|
||||
For a selecttype of <emphasis>syncitems</emphasis>, the date (in "yyyy-mm-dd hh:mm:ss" format) that you want to get updates since.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="year" count="opt"><scalar><des>
|
||||
For a selecttype of <emphasis>day</emphasis>, the 4-digit year of events you want to retrieve.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="month" count="opt"><scalar><des>
|
||||
For a selecttype of <emphasis>day</emphasis>, the 1- or 2-digit month of events you want to retrieve.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="day" count="opt"><scalar><des>
|
||||
For a selecttype of <emphasis>day</emphasis>, the 1- or 2-digit day of the month of events you want to retrieve.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="howmany" count="opt"><scalar><des>
|
||||
For a selecttype of <emphasis>lastn</emphasis>, how many entries to get. Defaults to 20. Maximum is 50.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="beforedate" count="opt"><scalar><des>
|
||||
For a selecttype of <emphasis>lastn</emphasis>, you can optionally include this variable and restrict all entries returned to be before the date you specify, which must be of the form <emphasis>yyyy-mm-dd hh:mm:ss</emphasis>.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="itemid" count="opt"><scalar><des>
|
||||
For a selecttype of <emphasis>one</emphasis>, the journal entry's unique ItemID for which you want to retrieve. Or, to retrieve the most recent entry, use the value -1. Using -1 has the added effect that the data is retrieved from the master database instead of a replicated slave. Clients with an "Edit last entry" feature might want to send -1, to make sure the data that comes back up is accurate, in case a slave database is a few seconds behind in replication.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="lineendings" count="1"><scalar><des>
|
||||
Specifies the type of line-endings you're using. Possible values are <emphasis>unix</emphasis> (0x0A (\n)), <emphasis>pc</emphasis> (0x0D0A (\r\n)), or <emphasis>mac</emphasis> (0x0D (\r) ). The default is not-Mac. Internally, LiveJournal stores all text as Unix-formatted text, and it does the conversion by removing all \r characters. If you're sending a multi-line event on Mac, you have to be sure and send a lineendings value of mac or your line endings will be removed. PC and Unix clients can ignore this setting, or you can send it. It may be used for something more in the future.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="usejournal" count="opt">
|
||||
<des>
|
||||
If getting the history of a shared journal, include this key and the username you wish to get the history of. By default, you load the history of "user" as specified above.
|
||||
</des>
|
||||
&useJournal;
|
||||
</key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 786
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.getevents</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>truncate</name>
|
||||
<value><int>20</int></value>
|
||||
</member>
|
||||
<member><name>selecttype</name>
|
||||
|
||||
<value><string>lastn</string></value>
|
||||
</member>
|
||||
<member><name>howmany</name>
|
||||
<value><int>2</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>noprops</name>
|
||||
<value><boolean>1</boolean></value>
|
||||
</member>
|
||||
<member><name>lineendings</name>
|
||||
|
||||
<value><string>unix</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="events" count="1"><list count="1"><des>
|
||||
A list of structs for all of the returned events.
|
||||
</des>
|
||||
<struct count="0more">
|
||||
|
||||
<key name="itemid" count="1"><scalar><des>
|
||||
The unique integer ItemID of the item being returned.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="eventtime" count="1"><scalar><des>
|
||||
The time the user posted (or said they posted, rather, since users can back-date posts) the item being returned.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="security" count="1"><scalar><des>
|
||||
If this variable is not returned, then the security of the post is <emphasis>public</emphasis>, otherwise this value will be <emphasis>private</emphasis> or usemask.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="allowmask" count="opt"><scalar><des>
|
||||
If security is <emphasis>usemask</emphasis> then this is defined with the 32-bit unsigned int bit-mask of who is allowed to access this post.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="subject" count="opt"><scalar><des>
|
||||
The subject of the journal entry. This won't be returned if "prefersubjects" is set, instead the subjects will show up as the events.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="event" count="1"><scalar><des>
|
||||
The event text itself. This value is first truncated if the truncate variable is set, and then it is URL-encoded (alphanumerics stay the same, weird symbols to %hh, and spaces to + signs, just like URLs or post request). This allows posts with line breaks to come back on one line.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="anum" count="1"><scalar><des>
|
||||
The authentication number generated for this entry. It can be used by the client to generate URLs, but that is not recommended. (See the returned 'url' element if you want to link to a post.)
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="url" count="1"><scalar><des>
|
||||
The permanent link address to this post. This is an opaque string--you should store it as is. While it will generally follow a predictable pattern, there is no guarantee of any particular format for these, and it may change in the future.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="poster" count="opt"><scalar><des>
|
||||
If the poster of this event is different from the <emphasis>user</emphasis> value sent above, then this key will be included and will specify the username of the poster of this event. If this key is not present, then it is safe to assume that the poster of this event is none other than <emphasis>user</emphasis>.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="props" count="opt"><struct count="0more"><des>
|
||||
Properties and their values for the item being returned.
|
||||
</des></struct></key>
|
||||
|
||||
</struct>
|
||||
</list></key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 1002
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 00:30:01 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>events</name>
|
||||
|
||||
<value><array>
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>eventtime</name>
|
||||
<value><string>2020-02-20 02:20:00</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>event</name>
|
||||
<value><string>yes its true its ...</string></value>
|
||||
</member>
|
||||
<member><name>anum</name>
|
||||
|
||||
<value><int>108</int></value>
|
||||
</member>
|
||||
<member><name>itemid</name>
|
||||
<value><int>1965</int></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>eventtime</name>
|
||||
<value><string>2002-07-14 11:17:00</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>event</name>
|
||||
<value><string>Yes, Yes, YES!</string></value>
|
||||
</member>
|
||||
<member><name>anum</name>
|
||||
|
||||
<value><int>66</int></value>
|
||||
</member>
|
||||
<member><name>subject</name>
|
||||
<value><string>Is this private?</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>itemid</name>
|
||||
<value><int>1964</int></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
100
livejournal/doc/raw/build/protocol/getfriendgroups.mode.xml
Executable file
100
livejournal/doc/raw/build/protocol/getfriendgroups.mode.xml
Executable file
@@ -0,0 +1,100 @@
|
||||
<method name="getfriendgroups">
|
||||
<shortdes>
|
||||
Retrieves a list of the user's defined groups of friends.
|
||||
</shortdes>
|
||||
<des>
|
||||
Retrieves a list of the user's defined groups of friends.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 406
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.getfriendgroups</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="friendgroups" count="1">
|
||||
&friendGroups;
|
||||
</key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 536
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 01:03:10 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>friendgroups</name>
|
||||
<value><array>
|
||||
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>sortorder</name>
|
||||
<value><int>25</int></value>
|
||||
</member>
|
||||
|
||||
<member><name>id</name>
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
<member><name>public</name>
|
||||
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
<member><name>name</name>
|
||||
<value><string>Good Friends</string></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
156
livejournal/doc/raw/build/protocol/getfriends.mode.xml
Executable file
156
livejournal/doc/raw/build/protocol/getfriends.mode.xml
Executable file
@@ -0,0 +1,156 @@
|
||||
<method name="getfriends">
|
||||
<shortdes>
|
||||
Returns a list of which other LiveJournal users this user lists as their friend.
|
||||
</shortdes>
|
||||
<des>
|
||||
Returns a verbose list of information on friends a user has listed. Optionally able to include their friends of list, the friends group associated with each user, and a limit on the number of friends to return.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="includefriendof" count="opt"><scalar><des>
|
||||
If set to 1, you will also get back the info from the "friendof" mode. Some clients show friends and friendof data in separate tabs/panes. If you're always going to load both, then use this flag (as opposed to a tabbed dialog approach, where the user may not go to the second tab and thus would not need to load the friendof data.) friendof request variables can be used.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="includegroups" count="opt"><scalar><des>
|
||||
If set to 1, you will also get back the info from the "getfriendgroups" mode. See above for the reason why this would be useful.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="friendlimit" count="opt"><scalar><des>
|
||||
If set to a numeric value greater than zero, this mode will only return the number of results indicated. Useful only for building pretty lists for display which might have a button to view the full list nearby.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 401
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.getfriends</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="friendgroups" count="1">
|
||||
&friendGroups;
|
||||
</key>
|
||||
|
||||
<key name="friendofs">
|
||||
&friendsList;
|
||||
</key>
|
||||
|
||||
<key name="friends">
|
||||
&friendsList;
|
||||
</key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 1377
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 00:44:23 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>friends</name>
|
||||
<value><array>
|
||||
|
||||
<data>
|
||||
<value><struct>
|
||||
<member><name>fgcolor</name>
|
||||
<value><string>#000000</string></value>
|
||||
</member>
|
||||
|
||||
<member><name>username</name>
|
||||
<value><string>bradfitz</string></value>
|
||||
</member>
|
||||
<member><name>fullname</name>
|
||||
|
||||
<value><string>Brad Fitzpatrick</string></value>
|
||||
</member>
|
||||
<member><name>bgcolor</name>
|
||||
<value><string>#ffffff</string></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>fgcolor</name>
|
||||
<value><string>#efcfff</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>username</name>
|
||||
<value><string>ljfresno</string></value>
|
||||
</member>
|
||||
<member><name>fullname</name>
|
||||
|
||||
<value><string>Fresno LJ users</string></value>
|
||||
</member>
|
||||
<member><name>type</name>
|
||||
<value><string>community</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>bgcolor</name>
|
||||
<value><string>#000000</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
<value><struct>
|
||||
<member><name>fgcolor</name>
|
||||
<value><string>#520155</string></value>
|
||||
</member>
|
||||
<member><name>username</name>
|
||||
|
||||
<value><string>webkin</string></value>
|
||||
</member>
|
||||
<member><name>fullname</name>
|
||||
<value><string>Ellen Stafford</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>bgcolor</name>
|
||||
<value><string>#fcddff</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
198
livejournal/doc/raw/build/protocol/login.mode.xml
Executable file
198
livejournal/doc/raw/build/protocol/login.mode.xml
Executable file
@@ -0,0 +1,198 @@
|
||||
<method name="login">
|
||||
<shortdes>
|
||||
validate user's password and get base information needed for client to function
|
||||
</shortdes>
|
||||
<des>
|
||||
Login to the server, while announcing your client version. The server returns with whether the password is good or not, the user's name, an optional message to be displayed to the user, the list of the user's friend groups, and other things.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="clientversion" count="opt"><scalar><des>
|
||||
Although optional, this <emphasis>should</emphasis> be a string of the form <literal>Platform-ProductName/ClientVersionMajor.Minor.Rev</literal>, like <emphasis>Win32-MFC/1.2.7</emphasis> or <emphasis>Gtk-LoserJabber/1.0.4</emphasis>. Note in this case that "Gtk" is not a platform, but rather a toolkit, since the toolkit is multi-platform (Linux, FreeBSD, Solaris, Windows...). You make the judge what is best to send, but if it's of this form, we'll give you cool statistics about your users.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="getmoods" count="opt"><scalar><des>
|
||||
If your client supports moods, send this key with a value of the highest mood ID you have cached/stored on the user's computer. For example, if you logged in last time with and got mood IDs 1, 2, 4, and 5, then send "5" as the value of "getmoods". The server will return every new mood that has an internal MoodID greater than 5. If you've never downloaded moods before, send "0". If you don't care about getting any moods at all (if your client doesn't support them), then don't send this key at all.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="getmenus" count="opt"><scalar><des>
|
||||
Send something for this key if you want to get a list/tree of web jump menus to show in your client.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="getpickws" count="opt"><scalar><des>
|
||||
If your client supports picture keywords and you want to receive that list, send something for this key, like "1", and you'll receieve the list of picture keywords the user has defined.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="getpickwurls" count="opt"><scalar><des>
|
||||
If your client supports picture keywords and can also display the pictures somehow, send something for this key, like "1", and you'll receieve the list of picture keyword URLs that correspond to the picture keywords as well as the URL for the default picture. You must send getpickws for this option to even matter.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 396
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.login</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="fullname" count="1"><scalar><des>
|
||||
The user's full name. Often, clients use this to change the top-level window's title bar text to say something like "LiveJournal - User name". You can just ignore this if you'd like.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="message" count="opt"><scalar><des>
|
||||
A message that <emphasis>should</emphasis> be displayed in a dialog box (or to the screen in a console application). The message is rarely present but when used notifies the user of software updates they've requested to hear about, problems with their account (if mail is bouncing to them, we'd like them to give us a current email address), etc. To test this if you're developing a client, use the user account <literal role="username">test</literal> with the password <literal>test</literal> and a message will always be returned.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="friendgroups" count="1">
|
||||
&friendGroups;
|
||||
</key>
|
||||
|
||||
<key name="usejournals" count="opt">
|
||||
&useJournals;
|
||||
</key>
|
||||
|
||||
<key name="moods" count="opt">
|
||||
<des>
|
||||
If you sent the 'getmoods' key in your request, this is returned. The contents are the new moods that have been added on the server since you last requested the list. Your client should cache the mood list on the client's computer to avoid requesting the whole list everytime.
|
||||
</des>
|
||||
&moods;
|
||||
</key>
|
||||
|
||||
<key name="pickws" count="opt">
|
||||
<des>
|
||||
This is requrned if you set "getpickws" in your request. Picture keywords are used to identify which userpic (100x100 icon) to use for that particular post. For instance, the user may have "Angry", "Happy", and "Sleepy" picture keywords which map to certain pictures. The client should also do a case-insensitive compare on this list when a mood is selected or entered, and auto-select the current picture keyword. That way it seems that selecting a mood also sets their corresponding picture.
|
||||
</des>
|
||||
<list count="1"><scalar count="0more"><des>
|
||||
The picture keyword.
|
||||
</des></scalar></list>
|
||||
</key>
|
||||
|
||||
<key name="pickwurls" count="opt">
|
||||
<des>
|
||||
The URLs of the user pictures. They correspond with the list of
|
||||
picture keywords returned. Note that the content behind these URLs
|
||||
can never change, so if your client downloads these to display, just
|
||||
cache them locally and never hit the servers again to re-download them
|
||||
or to even check if they've been modified.
|
||||
</des>
|
||||
<list count="1"><scalar count="0more"><des>
|
||||
The picture URL.
|
||||
</des></scalar></list>
|
||||
</key>
|
||||
|
||||
<key name="defaultpicurl" count="opt"><scalar><des>
|
||||
The URL of the default picture (if you sent the 'getpickwurls' key). Note that the content behind this URL can never change, so you can cache it locally; also note that the default picture might have no keyword associated with it.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="fastserver" count="opt"><scalar><des>
|
||||
LiveJournal sites may have priority servers for paying customers. If this key is both present and set to value "1", then the client has permission to set the "ljfastserver" cookie in subsequent requests. The HTTP request header to send is "Cookie: ljfastserver=1". If you send this header without getting permission from the login mode, your requests will fail. That is, you'll trick the load balancer into directing your request towards the priority servers, but the server you end up hitting won't be happy that you're trying to scam faster access and will deny your request.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="userid" count="1"><scalar><des>
|
||||
The userid of this user on the system. Not required for any other requests to
|
||||
the server, but some developers have wanted it.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="menus" count="opt">
|
||||
<des>Returned if you set "getmenus" in your request.</des>
|
||||
<list count="1">
|
||||
<des>List of menu items in order that should be in the LiveJournal web menu in the client application.</des>
|
||||
<struct count="0more">
|
||||
<key name="text" count="1"><scalar><des>
|
||||
The text of the menu item, or "-" for a separator.
|
||||
</des></scalar></key>
|
||||
<key name="url" count="opt"><scalar><des>
|
||||
The URL the menu item should launch, present for all menu items
|
||||
except separators and submenus.
|
||||
</des></scalar></key>
|
||||
<key name="sub" count="opt"><des>
|
||||
If this is present, this menu item is a submenu.
|
||||
</des><list count="0more">
|
||||
<des>Same format as top-level menu structure</des>
|
||||
<struct></struct>
|
||||
</list></key>
|
||||
</struct>
|
||||
</list>
|
||||
</key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 755
|
||||
Content-Type: text/xml
|
||||
Date: Sun, 14 Jul 2002 23:45:59 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
<member><name>userid</name>
|
||||
<value><int>3</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>message</name>
|
||||
<value><string>You need to validate your new email address.
|
||||
Your old one was good, but since you've changed it, you need to re-validate the new one.
|
||||
Visit the support area for more information.</string></value>
|
||||
</member>
|
||||
<member><name>fullname</name>
|
||||
|
||||
<value><string>Test Account</string></value>
|
||||
</member>
|
||||
<member><name>friendgroups</name>
|
||||
<value><array>
|
||||
<data>
|
||||
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
<member><name>usejournals</name>
|
||||
<value><array>
|
||||
<data>
|
||||
|
||||
<value><string>test2</string></value>
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
15
livejournal/doc/raw/build/protocol/moods.ent.xml
Executable file
15
livejournal/doc/raw/build/protocol/moods.ent.xml
Executable file
@@ -0,0 +1,15 @@
|
||||
<list count="1">
|
||||
<struct count="0more">
|
||||
|
||||
<key name="id"><scalar><des>
|
||||
The integer moodid.
|
||||
</des></scalar></key>
|
||||
<key name="name"><scalar><des>
|
||||
The mood name.
|
||||
</des></scalar></key>
|
||||
<key name="parent"><scalar><des>
|
||||
The mood's parent (base) moodid.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct>
|
||||
</list>
|
||||
178
livejournal/doc/raw/build/protocol/postevent.mode.xml
Executable file
178
livejournal/doc/raw/build/protocol/postevent.mode.xml
Executable file
@@ -0,0 +1,178 @@
|
||||
<method name="postevent">
|
||||
<shortdes>
|
||||
The most important mode, this is how a user actually submits a new log entry to the server.
|
||||
</shortdes>
|
||||
<des>
|
||||
Given all of the require information on a post, optioanlly adding security or meta data, will create a new entry. Will return the itemid of the new post.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="event" count="1"><scalar><des>
|
||||
The event/log text the user is submitting. Carriage returns are okay (0x0A, 0x0A0D, or 0x0D0A), although 0x0D are removed internally to make everything into Unix-style line-endings (just \ns). Posts may also contain HTML, but be aware that the LiveJournal server converts newlines to HTML <BR>s when displaying them, so your client should not try to insert these itself.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="lineendings" count="1"><scalar><des>
|
||||
Specifies the type of line-endings you're using. Possible values are <emphasis>unix</emphasis> (0x0A (\n)), <emphasis>pc</emphasis> (0x0D0A (\r\n)), or <emphasis>mac</emphasis> (0x0D (\r) ). The default is not-Mac. Internally, LiveJournal stores all text as Unix-formatted text, and it does the conversion by removing all \r characters. If you're sending a multi-line event on Mac, you have to be sure and send a lineendings value of mac or your line endings will be removed. PC and Unix clients can ignore this setting, or you can send it. It may be used for something more in the future.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="subject" count="1"><scalar><des>
|
||||
The subject for this post. Limited to 255 characters. No newlines.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="security" count="opt"><scalar><des>
|
||||
Specifies who can read this post. Valid values are <emphasis>public</emphasis> (default), <emphasis>private</emphasis> and <emphasis>usemask</emphasis>. When value is usemask, viewability is controlled by the allowmask.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="allowmask" count="opt"><scalar><des>
|
||||
Relevant when security is usemask. A 32-bit unsigned integer representing which of the user's groups of friends are allowed to view this post. Turn bit 0 on to allow any defined friend to read it. Otherwise, turn bit 1-30 on for every friend group that should be allowed to read it. Bit 31 is reserved.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="year" count="1"><scalar><des>
|
||||
The current 4-digit year (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="mon" count="1"><scalar><des>
|
||||
The current 1- or 2-digit month (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="day" count="1"><scalar><des>
|
||||
The current 1- or 2-digit day of the month (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="hour" count="1"><scalar><des>
|
||||
The current 1- or 2-digit hour from 0 to 23 (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="min" count="1"><scalar><des>
|
||||
The current 1- or 2-digit minute (from the user's local timezone).
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="props" count="opt">
|
||||
<des>
|
||||
Set arbitrary (but restricted) meta-data properties to this log item. See <link id="ljp.csp.proplist" />
|
||||
for the documentation of the keys and value data types.
|
||||
</des>
|
||||
<list count="1">
|
||||
<des>The following 'struct' should have property names as the keys, and the values should be a scalar data type.</des>
|
||||
<struct count="0more"/>
|
||||
</list>
|
||||
</key>
|
||||
|
||||
<key name="usejournal" count="opt">
|
||||
<des>
|
||||
If posting to a shared journal, include this key and the username you wish to post to. By default, you post to the journal of "user" as specified above.
|
||||
</des>
|
||||
&useJournal;
|
||||
</key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 927
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.postevent</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>event</name>
|
||||
<value><string>This is a test post.
|
||||
</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>subject</name>
|
||||
<value><string>Test</string></value>
|
||||
</member>
|
||||
<member><name>lineendings</name>
|
||||
|
||||
<value><string>pc</string></value>
|
||||
</member>
|
||||
<member><name>year</name>
|
||||
<value><int>2002</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>mon</name>
|
||||
<value><int>7</int></value>
|
||||
</member>
|
||||
<member><name>day</name>
|
||||
|
||||
<value><int>13</int></value>
|
||||
</member>
|
||||
<member><name>hour</name>
|
||||
<value><int>20</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>min</name>
|
||||
<value><int>35</int></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="anum" count="1"><scalar><des>
|
||||
The key number used to calculate the public itemid ID number for URLs.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="itemid" count="1"><scalar><des>
|
||||
The unique number the server assigned to this post. Currently nothing else in the protocol requires the use of this number so it's pretty much useless, but somebody requested it be returned, so it is.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="anum" count="1"><scalar><des>
|
||||
The authentication number generated for this entry. It can be used by the client to generate URLs, but that is not recommended. (See the returned 'url' element if you want to link to a post.)
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="url" count="1"><scalar><des>
|
||||
The permanent link address to this post. This is an opaque string--you should store it as is. While it will generally follow a predictable pattern, there is no guarantee of any particular format for these, and it may change in the future.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct>
|
||||
</returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: closer
|
||||
Content-length: 239
|
||||
Content-Type: text/xml
|
||||
Date: Sat, 13 Jul 2002 23:49:53 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
|
||||
<member><name>anum</name>
|
||||
<value><int>141</int></value>
|
||||
</member>
|
||||
<member><name>itemid</name>
|
||||
|
||||
<value><int>1959</int></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
35
livejournal/doc/raw/build/protocol/proplist2db.pl
Executable file
35
livejournal/doc/raw/build/protocol/proplist2db.pl
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
require "$ENV{'LJHOME'}/cgi-bin/ljlib.pl";
|
||||
|
||||
my $dbr = LJ::get_dbh("slave", "master");
|
||||
my $sth;
|
||||
|
||||
my $sth = $dbr->prepare("SELECT * FROM logproplist ORDER BY sortorder");
|
||||
$sth->execute;
|
||||
|
||||
print "<variablelist>\n";
|
||||
print " <title>Log Prop List</title>\n\n";
|
||||
|
||||
while (my $r = $sth->fetchrow_hashref)
|
||||
{
|
||||
print " <varlistentry>\n";
|
||||
print " <term><literal role='log.prop'>$r->{'name'}</literal></term>\n";
|
||||
print " <listitem><formalpara><title>$r->{'prettyname'}</title>\n";
|
||||
print " <para>$r->{'des'}</para>\n";
|
||||
print " <itemizedlist>\n";
|
||||
print " <listitem><formalpara><title>Datatype</title>\n";
|
||||
print " <para>$r->{'datatype'}</para>\n";
|
||||
print " </formalpara></listitem>\n";
|
||||
print " <listitem><formalpara><title>Scope</title>\n";
|
||||
print " <para>$r->{'scope'}</para>\n";
|
||||
print " </formalpara></listitem>\n";
|
||||
print " </itemizedlist>\n";
|
||||
print " </formalpara></listitem>\n";
|
||||
print " </varlistentry>\n\n";
|
||||
}
|
||||
|
||||
print "</variablelist>\n";
|
||||
89
livejournal/doc/raw/build/protocol/sessionexpire.mode.xml
Executable file
89
livejournal/doc/raw/build/protocol/sessionexpire.mode.xml
Executable file
@@ -0,0 +1,89 @@
|
||||
<method name="sessionexpire">
|
||||
<shortdes>
|
||||
Expires session cookies.
|
||||
</shortdes>
|
||||
<des>
|
||||
Using this request mode, you can expire previously generated sessions, whether you
|
||||
generated them using the sessiongenerate call or the user logged in on the web site.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="expireall" count="opt">
|
||||
<scalar><des>
|
||||
If present and true, then all of the user's sessions will be expired.
|
||||
</des></scalar>
|
||||
</key>
|
||||
|
||||
<key name="expire" count="opt">
|
||||
<list>
|
||||
<scalar count="0more"><des>
|
||||
Given a list of session ids, will expire each one individually. Session ids can be
|
||||
obtained from previous calls to sessiongenerate--notably, the id is the third field
|
||||
in the session.
|
||||
</des></scalar>
|
||||
</list>
|
||||
</key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 542
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.sessionexpire</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>expireall</name>
|
||||
<value><int>1</int></value>
|
||||
</member>
|
||||
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 1189
|
||||
Content-Type: text/xml
|
||||
Date: Fri, 26 Mar 2004 18:39:38 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct/></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
108
livejournal/doc/raw/build/protocol/sessiongenerate.mode.xml
Executable file
108
livejournal/doc/raw/build/protocol/sessiongenerate.mode.xml
Executable file
@@ -0,0 +1,108 @@
|
||||
<method name="sessiongenerate">
|
||||
<shortdes>
|
||||
Generate a session cookie.
|
||||
</shortdes>
|
||||
<des>
|
||||
In order to interact with some web based parts of the site, such as the
|
||||
comment exporter, it is often useful to be able to generate a login cookie
|
||||
without having to actually post login information to the login.bml page.
|
||||
This mode will, with proper authentication, provide you with a session
|
||||
cookie to use for authentication purposes.
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="expiration" count="opt">
|
||||
<scalar><des>
|
||||
Sessions can either expire in a short amount of time or last for a long period
|
||||
of time. You can specify either "short" or "long" as the value of this parameter.
|
||||
</des></scalar>
|
||||
</key>
|
||||
|
||||
<key name="ipfixed" count="opt">
|
||||
<scalar><des>
|
||||
If specified and true, this will cause the server to generate a session that is
|
||||
only valid from the IP address the sessiongenerate request was sent from. If you
|
||||
leave out this value, it will default to allowing any IP address to use this
|
||||
session information.
|
||||
</des></scalar>
|
||||
</key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 542
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.sessiongenerate</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>expiration</name>
|
||||
<value><string>long</string></value>
|
||||
</member>
|
||||
|
||||
<member><name>ipfixed</name>
|
||||
<value><string>1</string></value>
|
||||
</member>
|
||||
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="ljsession" count="1">
|
||||
<scalar><des>
|
||||
The session generated.
|
||||
</des></scalar>
|
||||
</key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 228
|
||||
Content-Type: text/xml
|
||||
Date: Fri, 26 Mar 2004 18:14:17 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
<value><struct>
|
||||
|
||||
<member><name>ljsession</name>
|
||||
<value><string>ws:test:124:zfFG136kSz</string>
|
||||
</value></member>
|
||||
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
259
livejournal/doc/raw/build/protocol/syncitems.mode.xml
Executable file
259
livejournal/doc/raw/build/protocol/syncitems.mode.xml
Executable file
@@ -0,0 +1,259 @@
|
||||
<method name="syncitems">
|
||||
<shortdes>
|
||||
Returns a list of all the items that have been created or updated for a user.
|
||||
</shortdes>
|
||||
<des>
|
||||
Returns a list (or part of a list) of all the items (journal entries, to-do items, comments) that have been created or updated on LiveJournal since you last downloaded them. Note that the items themselves are not returned --- only the item type and the item number. After you get this you have to go fetch the items using another protocol mode. For journal entries (type "L"), use the getevents mode with a selecttype of "syncitems".
|
||||
</des>
|
||||
<arguments><struct count="1">
|
||||
|
||||
&authInfo;
|
||||
|
||||
<key name="lastsync" count="opt"><scalar><des>
|
||||
The date you last downloaded synced, in "yyyy-mm-dd hh:mm:ss" format. <emphasis>Note</emphasis>: do not make this date up from the client's local computer... send the date from this mode's response of the newest item you have saved on disk.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></arguments>
|
||||
|
||||
<expost>
|
||||
POST /interface/xmlrpc HTTP/1.0
|
||||
User-Agent: XMLRPC Client 1.0
|
||||
Host: www.livejournal.com
|
||||
Content-Type: text/xml
|
||||
Content-Length: 495
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodCall>
|
||||
<methodName>LJ.XMLRPC.syncitems</methodName>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>username</name>
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>password</name>
|
||||
|
||||
<value><string>test</string></value>
|
||||
</member>
|
||||
<member><name>ver</name>
|
||||
<value><int>1</int></value>
|
||||
|
||||
</member>
|
||||
<member><name>lastsync</name>
|
||||
<value><string>2002-07-13 00:00:00</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
</param>
|
||||
</params>
|
||||
</methodCall>
|
||||
</expost>
|
||||
|
||||
<!--===================[ RETURN ]==============================-->
|
||||
<returns><struct count="1">
|
||||
|
||||
<key name="syncitems" count="1"><list count="1"><struct count="0more">
|
||||
<key name="item" count="1"><scalar><des>
|
||||
The nth item, in the form "Type-Number". Type can be one of "L" for log entries (journal entries), "C" for comments (not implemented), "T" for to-do items (not implemented), or many other things presumably. If your client doesn't know how to fetch an item of a certain type, just ignore them. A new version of your client could later see that it has never downloaded anything of type "T" and go back and fetch everything of that type from the beginning.
|
||||
</des></scalar></key>
|
||||
<key name="action" count="1"><scalar><des>
|
||||
Either "create" or "update". This field isn't too useful, but you may want to make your client verbose and tell the user what it's doing. For example, "Downloading entry 5 of 17: Updated".
|
||||
</des></scalar></key>
|
||||
<key name="time" count="1"><scalar><des>
|
||||
The server time (in the form "yyyy-mm-dd hh:mm:ss") that this creation or update took place. Remember in your local store the most recent for each item type ("L", "T", "C", etc...). This is what you send in subsequent requests in lastsync.
|
||||
</des></scalar></key>
|
||||
</struct></list></key>
|
||||
|
||||
<key name="count" count="1"><scalar><des>
|
||||
The number of items that are contained in this response (numbered started at 1). If sync_count is equal to sync_total, then you can stop your sync after you complete fetching every item in this response.
|
||||
</des></scalar></key>
|
||||
|
||||
<key name="total" count="1"><scalar><des>
|
||||
The total number of items that have been updated since the time specified.
|
||||
</des></scalar></key>
|
||||
|
||||
</struct></returns>
|
||||
|
||||
<exreturn>
|
||||
HTTP/1.1 200 OK
|
||||
Connection: close
|
||||
Content-length: 3360
|
||||
Content-Type: text/xml
|
||||
Date: Tue, 16 Jul 2002 22:39:30 GMT
|
||||
Server: Apache/1.3.4 (Unix)
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<methodResponse>
|
||||
<params>
|
||||
<param>
|
||||
|
||||
<value><struct>
|
||||
<member><name>total</name>
|
||||
<value><int>11</int></value>
|
||||
</member>
|
||||
<member><name>count</name>
|
||||
|
||||
<value><int>11</int></value>
|
||||
</member>
|
||||
<member><name>syncitems</name>
|
||||
<value><array>
|
||||
<data>
|
||||
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1947</string></value>
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
|
||||
<value><string>2002-07-13 00:06:26</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
<value><string>del</string></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1954</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
<value><string>2002-07-13 00:09:05</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
|
||||
<value><string>del</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
|
||||
<value><string>L-1958</string></value>
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
<value><string>2002-07-13 02:01:07</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
<value><string>create</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1948</string></value>
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
|
||||
<value><string>2002-07-13 08:27:56</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
<value><string>update</string></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1960</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
<value><string>2002-07-14 02:52:18</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
|
||||
<value><string>create</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
|
||||
<value><string>L-1961</string></value>
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
<value><string>2002-07-14 03:07:55</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
<value><string>create</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1962</string></value>
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
|
||||
<value><string>2002-07-14 03:08:14</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
<value><string>create</string></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1963</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
<value><string>2002-07-14 03:13:26</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
|
||||
<value><string>create</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
|
||||
<value><string>L-1964</string></value>
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
<value><string>2002-07-14 03:17:03</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
<value><string>create</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1959</string></value>
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
|
||||
<value><string>2002-07-14 14:25:07</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
<value><string>update</string></value>
|
||||
|
||||
</member>
|
||||
</struct></value>
|
||||
<value><struct>
|
||||
<member><name>item</name>
|
||||
<value><string>L-1965</string></value>
|
||||
|
||||
</member>
|
||||
<member><name>time</name>
|
||||
<value><string>2002-07-16 04:36:15</string></value>
|
||||
</member>
|
||||
<member><name>action</name>
|
||||
|
||||
<value><string>update</string></value>
|
||||
</member>
|
||||
</struct></value>
|
||||
</data>
|
||||
</array></value>
|
||||
</member>
|
||||
|
||||
</struct></value>
|
||||
</param>
|
||||
</params>
|
||||
</methodResponse>
|
||||
</exreturn>
|
||||
|
||||
</method>
|
||||
3
livejournal/doc/raw/build/protocol/usejournal.ent.xml
Executable file
3
livejournal/doc/raw/build/protocol/usejournal.ent.xml
Executable file
@@ -0,0 +1,3 @@
|
||||
<scalar count="1"><des>
|
||||
Journal username that authenticating user has 'usejournal' access in, as given in the 'login' mode.
|
||||
</des></scalar>
|
||||
7
livejournal/doc/raw/build/protocol/usejournals.ent.xml
Executable file
7
livejournal/doc/raw/build/protocol/usejournals.ent.xml
Executable file
@@ -0,0 +1,7 @@
|
||||
<des>
|
||||
List of shared/news/community journals that the user has permission
|
||||
to post in.
|
||||
</des>
|
||||
<list count="1"><scalar count="0more"><des>
|
||||
Username of community journal.
|
||||
</des></scalar></list>
|
||||
129
livejournal/doc/raw/build/protocol/xml-rpc2db.xsl
Executable file
129
livejournal/doc/raw/build/protocol/xml-rpc2db.xsl
Executable file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" />
|
||||
|
||||
<xsl:template match="/"><xsl:apply-templates/></xsl:template>
|
||||
<xsl:template match="ljxmlrpc"><xsl:apply-templates/></xsl:template>
|
||||
|
||||
<xsl:template match="method">
|
||||
<refentry><xsl:attribute name="id"><xsl:text>ljp.csp.xml-rpc.</xsl:text><xsl:value-of select="@name"/></xsl:attribute>
|
||||
<refnamediv>
|
||||
<refname><xsl:value-of select="@name"/></refname>
|
||||
<refpurpose><xsl:value-of select="shortdes"/></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1>
|
||||
<title>Mode Description</title>
|
||||
<para>
|
||||
<xsl:value-of select="des"/>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Arguments</title>
|
||||
<orderedlist>
|
||||
<xsl:for-each select="arguments">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:for-each>
|
||||
</orderedlist>
|
||||
|
||||
<example>
|
||||
<title>Sample call to <literal>LJ.XMLRPC.<xsl:value-of select="@name"/></literal></title>
|
||||
<para><programlisting>
|
||||
<xsl:value-of select="expost"/>
|
||||
</programlisting></para>
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Return Values</title>
|
||||
<orderedlist>
|
||||
<xsl:for-each select="returns">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:for-each>
|
||||
</orderedlist>
|
||||
|
||||
<example>
|
||||
<title>Sample return value for <literal>LJ.XMLRPC.<xsl:value-of select="@name"/></literal></title>
|
||||
<para><programlisting>
|
||||
<xsl:value-of select="exreturn"/>
|
||||
</programlisting></para>
|
||||
</example>
|
||||
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="link">
|
||||
<xref><xsl:attribute name="linkend"><xsl:value-of select="@id"/></xsl:attribute></xref>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="struct">
|
||||
<listitem><para>
|
||||
<emphasis>[struct]</emphasis>
|
||||
<xsl:call-template name="count"/>
|
||||
<xsl:for-each select="des">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:for-each>
|
||||
</para><para>
|
||||
Containing keys:
|
||||
<itemizedlist>
|
||||
<xsl:for-each select="*">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:for-each>
|
||||
</itemizedlist>
|
||||
</para></listitem>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="scalar">
|
||||
<listitem><para>
|
||||
<emphasis>[scalar]</emphasis>
|
||||
<xsl:call-template name="count"/>
|
||||
<xsl:for-each select="*">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:for-each>
|
||||
</para></listitem>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="key">
|
||||
<listitem><para>
|
||||
<emphasis role="bold"><xsl:value-of select="@name"/></emphasis>
|
||||
<xsl:call-template name="count"/>:
|
||||
<xsl:for-each select="des">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:for-each>
|
||||
<itemizedlist>
|
||||
<xsl:for-each select="*">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:for-each>
|
||||
</itemizedlist>
|
||||
</para></listitem>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="list">
|
||||
<listitem><para>
|
||||
<emphasis>[array]</emphasis>
|
||||
<xsl:call-template name="count"/>
|
||||
<xsl:value-of select="des"/>
|
||||
Containing items:
|
||||
<itemizedlist>
|
||||
<xsl:for-each select="scalar|struct|list">
|
||||
<xsl:apply-templates select="."/>
|
||||
</xsl:for-each>
|
||||
</itemizedlist>
|
||||
</para></listitem>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="count">
|
||||
<xsl:choose>
|
||||
<xsl:when test="@count='1'">(required)</xsl:when>
|
||||
<xsl:when test="@count='opt'">(optional)</xsl:when>
|
||||
<xsl:when test="@count='1more'">(required; multiple allowed)</xsl:when>
|
||||
<xsl:when test="@count='0more'">(optional; multiple allowed)</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
41
livejournal/doc/raw/build/protocol/xmlrpc.dtd
Executable file
41
livejournal/doc/raw/build/protocol/xmlrpc.dtd
Executable file
@@ -0,0 +1,41 @@
|
||||
<!-- the 'count' attribute indicates how many times it appears in its
|
||||
parent container. either:
|
||||
1 (once always),
|
||||
opt (optionally once),
|
||||
1more (1 or more times),
|
||||
0more (0 or more times) -->
|
||||
<!ENTITY % countatt "count (1|opt|1more|0more) '1'">
|
||||
|
||||
<!-- presence of keys are either there or optionally there,
|
||||
can't be more than 1: -->
|
||||
<!ENTITY % keycountatt "count (1|opt) '1'">
|
||||
|
||||
<!ELEMENT ljxmlrpc (method*)>
|
||||
|
||||
<!ELEMENT method (shortdes?, des?, arguments, returns, expost, exreturn)>
|
||||
<!ATTLIST method name NMTOKEN #REQUIRED>
|
||||
|
||||
<!-- arguments and return both have a list of values, either structs, lists, or scalars -->
|
||||
<!ELEMENT arguments (struct | list | scalar)*>
|
||||
<!ELEMENT returns (struct | list | scalar)*>
|
||||
|
||||
<!ELEMENT scalar (des?)>
|
||||
<!ATTLIST scalar %countatt;>
|
||||
|
||||
<!ELEMENT struct (key*)>
|
||||
<!ATTLIST struct %countatt;>
|
||||
|
||||
<!ELEMENT key (des?, (scalar | struct | list))>
|
||||
<!ATTLIST key name NMTOKEN #REQUIRED %keycountatt;>
|
||||
|
||||
<!ELEMENT list (des?, (struct | list | scalar)*)>
|
||||
<!ATTLIST list %countatt;>
|
||||
|
||||
<!ELEMENT shortdes (#PCDATA)>
|
||||
<!ELEMENT des (#PCDATA|link)*>
|
||||
|
||||
<!ELEMENT link (#PCDATA)>
|
||||
<!ATTLIST link id NMTOKEN #REQUIRED>
|
||||
|
||||
<!ELEMENT expost (#PCDATA)>
|
||||
<!ELEMENT exreturn (#PCDATA)>
|
||||
47
livejournal/doc/raw/build/protocol/xmlrpc.xml
Executable file
47
livejournal/doc/raw/build/protocol/xmlrpc.xml
Executable file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE ljxmlrpc SYSTEM "xmlrpc.dtd" [
|
||||
|
||||
<!ENTITY authInfo SYSTEM "authinfo.ent.xml">
|
||||
<!ENTITY useJournals SYSTEM "usejournals.ent.xml">
|
||||
<!ENTITY useJournal SYSTEM "usejournal.ent.xml">
|
||||
<!ENTITY friendGroups SYSTEM "friendgroups.ent.xml">
|
||||
<!ENTITY moods SYSTEM "moods.ent.xml">
|
||||
<!ENTITY friendsList SYSTEM "friendslist.ent.xml">
|
||||
|
||||
<!ENTITY mode.checkfriends SYSTEM "checkfriends.mode.xml">
|
||||
<!ENTITY mode.consolecommand SYSTEM "consolecommand.mode.xml">
|
||||
<!ENTITY mode.editevent SYSTEM "editevent.mode.xml">
|
||||
<!ENTITY mode.editfriendgroups SYSTEM "editfriendgroups.mode.xml">
|
||||
<!ENTITY mode.editfriends SYSTEM "editfriends.mode.xml">
|
||||
<!ENTITY mode.friendof SYSTEM "friendof.mode.xml">
|
||||
<!ENTITY mode.getchallenge SYSTEM "getchallenge.mode.xml">
|
||||
<!ENTITY mode.getdaycounts SYSTEM "getdaycounts.mode.xml">
|
||||
<!ENTITY mode.getevents SYSTEM "getevents.mode.xml">
|
||||
<!ENTITY mode.getfriendgroups SYSTEM "getfriendgroups.mode.xml">
|
||||
<!ENTITY mode.getfriends SYSTEM "getfriends.mode.xml">
|
||||
<!ENTITY mode.login SYSTEM "login.mode.xml">
|
||||
<!ENTITY mode.postevent SYSTEM "postevent.mode.xml">
|
||||
<!ENTITY mode.sessionexpire SYSTEM "sessionexpire.mode.xml">
|
||||
<!ENTITY mode.sessiongenerate SYSTEM "sessiongenerate.mode.xml">
|
||||
<!ENTITY mode.syncitems SYSTEM "syncitems.mode.xml">
|
||||
]>
|
||||
<ljxmlrpc>
|
||||
|
||||
&mode.checkfriends;
|
||||
&mode.consolecommand;
|
||||
&mode.editevent;
|
||||
&mode.editfriendgroups;
|
||||
&mode.editfriends;
|
||||
&mode.friendof;
|
||||
&mode.getchallenge;
|
||||
&mode.getdaycounts;
|
||||
&mode.getevents;
|
||||
&mode.getfriends;
|
||||
&mode.getfriendgroups;
|
||||
&mode.login;
|
||||
&mode.postevent;
|
||||
&mode.sessionexpire;
|
||||
&mode.sessiongenerate;
|
||||
&mode.syncitems;
|
||||
|
||||
</ljxmlrpc>
|
||||
66
livejournal/doc/raw/build/titlepage.xsl
Executable file
66
livejournal/doc/raw/build/titlepage.xsl
Executable file
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:template match="abstract" mode="titlepage.mode">
|
||||
<div class="{name(.)}">
|
||||
<h3>Abstract</h3>
|
||||
<p><xsl:apply-templates mode="titlepage.mode"/></p>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="authorgroup" mode="titlepage.mode">
|
||||
<div class="{name(.)}">
|
||||
<h3>Authors</h3>
|
||||
<p>
|
||||
<xsl:apply-templates mode="titlepage.mode"/>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="author" mode="titlepage.mode">
|
||||
<b class="{name(.)}"><xsl:call-template name="person.name"/></b>
|
||||
<xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
|
||||
<xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
|
||||
<br />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="editor" mode="titlepage.mode">
|
||||
<b class="{name(.)}">Editor: <xsl:call-template name="person.name"/></b>
|
||||
<xsl:apply-templates mode="titlepage.mode" select="./contrib"/>
|
||||
<xsl:apply-templates mode="titlepage.mode" select="./affiliation"/>
|
||||
<br />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="address" mode="titlepage.mode">
|
||||
<xsl:param name="suppress-numbers" select="'0'"/>
|
||||
|
||||
<xsl:variable name="rtf">
|
||||
<xsl:apply-templates mode="titlepage.mode"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$suppress-numbers = '0'
|
||||
and @linenumbering = 'numbered'
|
||||
and $use.extensions != '0'
|
||||
and $linenumbering.extension != '0'">
|
||||
<div class="{name(.)}">
|
||||
<p>
|
||||
<xsl:call-template name="number.rtf.lines">
|
||||
<xsl:with-param name="rtf" select="$rtf"/>
|
||||
</xsl:call-template>
|
||||
</p>
|
||||
</div>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates mode="titlepage.mode"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="affiliation" mode="titlepage.mode">
|
||||
<xsl:apply-templates mode="titlepage.mode"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user