XML-RPC Protocol Method: getdaycounts

From Dreamwidth Notes
Jump to: navigation, search
Needs Update: This documentation was ported over from LJ's Server Manual with minimal modification. It may not match Dreamwidth's implementation of the method, and needs to be double checked against the DW code and updated as necessary.

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.

Inputs

username Scalar. Required. Username of user logging in.

auth_method Scalar. Optional. 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 Deprecated. Scalar. Optional. Password of user logging in in plaintext. If using the "clear" authentication method, either this or "hpassword" must be present.

hpassword Deprecated. Scalar. Optional. MD5 digest of user's password. Not much more secure than password, but at least it's not in plain text.

auth_challenge Scalar. Optional. If using challenge-response authentication, this should be the challenge that was issued to you by the server.

auth_response Scalar. Optional. If using challenge-response authentication, this should be the response hash that you generate, based on the formula required for your challenge.

ver Scalar. Optional. Protocol version supported by the client; assumed to be 0 if not specified. See Protocol Versions for details on the protocol version.

usejournal Scalar. 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.

Example Request

POST /interface/xmlrpc HTTP/1.0
User-Agent: XMLRPC Client 1.0
Host: www.dreamwidth.org
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>

Outputs

daycounts Array of structs. Required. For each day that the user has posted a journal entry, a struct is returned containing these keys:

  • date Scalar. Required. The date, in yyyy-dd-mm format.
  • count Scalar. Required. The number of journal entries on that date.

Example Response

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>