friendof

friendof — Returns a list of which other LiveJournal users list this user as their friend.

Mode Description

Returns a "friends of" list for a specified user. An optional limit of returned friends can be supplied.

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 27, Protocol Versions for details on the protocol version.

    • friendoflimit(optional):

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

Example 13. Sample call to LJ.XMLRPC.friendof

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>


Return Values

  1. [struct](required)

    Containing keys:

    • friendofs(required): The list of people who list this user as a friend.

      • [array](required) Containing items:

        • [struct](optional; multiple allowed)

          Containing keys:

          • username(required):

            • [scalar](required) The username of the friend.

          • fullname(required):

            • [scalar](required) The full name of the friend.

          • identity_type(required):

            • [scalar](required) If type is identity: Type of identity user, OpenID, TypeKey, etc.

          • identity_value(required):

            • [scalar](required) If type is identity: Value for identity, OpenID is a URL.

          • identity_display(required):

            • [scalar](required) If type is identity: Pretty display name of an identity user.

          • type(optional):

            • [scalar](required) The type of journal the friend item is. This value can be one of 'community', 'syndicated', 'news', 'shared', or identity (I), depending on the journaltype of the account in question. The account is a normal personal account when this value is not sent.

          • birthday(optional):

            • [scalar](required) The birthday is returned only with the getfriends mode, and only if the user has set their birthday to be publicly visible on their profile. To receive this field you will also need to request it, using the includebdays key.

          • fgcolor(required):

            • [scalar](required) The foreground color of the friend item.

          • bgcolor(required):

            • [scalar](required) The background color of the friend item.

          • groupmask(required):

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

Example 14. Sample return value for LJ.XMLRPC.friendof

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>