»

getdaycounts

getdaycounts — This mode retrieves the number of journal entries per day.

Mode Description

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.

Arguments

  1. [struct](required)

    Containing keys:

    • username(required):

      • [scalar](required) Username of user logging in.

    • auth_method(optional):

      • [scalar](required) 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.

    • password(optional):

      • [scalar](required) DEPRECATED. Password of user logging in in plaintext. If using the "clear" authentication method, either this or "hpassword" must be present.

    • hpassword(optional):

      • [scalar](required) DEPRECATED. MD5 digest of user's password. Not much more secure than password, but at least it's not in plain text.

    • auth_challenge(optional):

      • [scalar](required) If using challenge / response authentication, this should be the challenge that was issued to you by the server.

    • auth_response(optional):

      • [scalar](required) If using challenge / response authentication, this should be the response hash that you generate, based on the formula required for your challenge.

    • ver(optional):

      • [scalar](required) Protocol version supported by the client; assumed to be 0 if not specified. See Chapter 11: Protocol Versions for details on the protocol version

    • usejournal(optional): 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.

      • [scalar](required) Journal username that authenticating user has 'usejournal' access in, as given in the 'login' mode.

Example 17. Sample call to LJ.XMLRPC.getdaycounts

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>

Return Values

  1. [struct](required)

    Containing keys:

    • daycounts(required):

      • [array](required) Containing items:

        • [struct](optional; multiple allowed) For each day that the user has posted a journal entry, a struct is returned in the list.

          Containing keys:

          • date(required):

            • [scalar](required)The date, in yyyy-dd-mm format.

          • count(required):

            • [scalar](required)The number of journal entries on that date.

Example 18. Sample return value for LJ.XMLRPC.getdaycounts

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>