user.sites()
view-source14x14.png

Purpose

Method user.sites() retrieves meta data for all sites a user is member of, like name, title, and private flag.

Syntax

user.sites({'user': 'user-name'})

Arguments

user-name
must be the name of the user you have authenticated with

Returns

All sites that user-name is a member of are returned as a list of dictionaries with the following keys:

'name'
The site-name part in the URL http://site-name.wikidot.com
'private'
true if the site is private, false otherwise
'title'
The site's title as it can be found in the Site Manager's General Settings under “Site name”

Note that the sites are returned in an arbitrary order. To sort the returned list, see the Sort Returned Data snippet.

Remarks

The API will only allow you to list the authenticated user's sites. In contrast, you may list all sites that any specific users is a member of, click on the Link “Member of” on that user's profile page http://www.wikidot.com/user:info/user-name.

Example

The example assumes that s is a successfully authenticated ServerProxy object.

What you type … What you get …

print s.user.sites({'user': 'user-name'})

[{'name': 'community', 'private': False,
  'title': 'Wikidot.com Community Portal'},
{'name': 'xml-api', 'private': False,
  'title': 'Wikidot XML RPC-API'}]

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License