ljr/livejournal/doc/raw/build/protocol/getevents.mode.xml

236 lines
10 KiB
XML
Executable File

<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
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;methodCall&gt;
&lt;methodName&gt;LJ.XMLRPC.getevents&lt;/methodName&gt;
&lt;params&gt;
&lt;param&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;username&lt;/name&gt;
&lt;value&gt;&lt;string&gt;test&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;password&lt;/name&gt;
&lt;value&gt;&lt;string&gt;test&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;ver&lt;/name&gt;
&lt;value&gt;&lt;int&gt;1&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;truncate&lt;/name&gt;
&lt;value&gt;&lt;int&gt;20&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;selecttype&lt;/name&gt;
&lt;value&gt;&lt;string&gt;lastn&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;howmany&lt;/name&gt;
&lt;value&gt;&lt;int&gt;2&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;noprops&lt;/name&gt;
&lt;value&gt;&lt;boolean&gt;1&lt;/boolean&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;lineendings&lt;/name&gt;
&lt;value&gt;&lt;string&gt;unix&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/param&gt;
&lt;/params&gt;
&lt;/methodCall&gt;
</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)
&lt;?xml version="1.0"?&gt;
&lt;methodResponse&gt;
&lt;params&gt;
&lt;param&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;events&lt;/name&gt;
&lt;value&gt;&lt;array&gt;
&lt;data&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;eventtime&lt;/name&gt;
&lt;value&gt;&lt;string&gt;2020-02-20 02:20:00&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;event&lt;/name&gt;
&lt;value&gt;&lt;string&gt;yes its true its ...&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;anum&lt;/name&gt;
&lt;value&gt;&lt;int&gt;108&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;itemid&lt;/name&gt;
&lt;value&gt;&lt;int&gt;1965&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;value&gt;&lt;struct&gt;
&lt;member&gt;&lt;name&gt;eventtime&lt;/name&gt;
&lt;value&gt;&lt;string&gt;2002-07-14 11:17:00&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;event&lt;/name&gt;
&lt;value&gt;&lt;string&gt;Yes, Yes, YES!&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;anum&lt;/name&gt;
&lt;value&gt;&lt;int&gt;66&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;subject&lt;/name&gt;
&lt;value&gt;&lt;string&gt;Is this private?&lt;/string&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;member&gt;&lt;name&gt;itemid&lt;/name&gt;
&lt;value&gt;&lt;int&gt;1964&lt;/int&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/data&gt;
&lt;/array&gt;&lt;/value&gt;
&lt;/member&gt;
&lt;/struct&gt;&lt;/value&gt;
&lt;/param&gt;
&lt;/params&gt;
&lt;/methodResponse&gt;
</exreturn>
</method>