page.get()
view-source14x14.png

Purpose

Method page.get() retrieves a page's

  • content (both Wikidot syntax and HTML) and
  • meta data like page title, parent page, when created/edited, and attached tags.

Syntax

page.get({'site': 'site-name', 'page': 'page-name'})

Arguments

site-name
the name of the site, from which a page should be retrieved
page-name
the unix name (including its category) of the page to be be retrieved

Returns

The page's content together with some meta data is returned as a dictionary with the following keys:

'source'
the page's Wikidot markup
'html'
the page's HTML representation
'meta'
a dictionary of the following page meta data. Note that the value of the 'meta' key is equivalent to the structure of the dictionaries that site.pages() returns a list of.
'site'
the site's name the page is from
'category'
the page's category
'name'
the page name (without the category)
'full_name'
equal to 'name' if 'category' is _default, 'category':'name' otherwise
'title'
the page title as defined by the user
'title_shown'
the page title as displayed, including any autonumbering pattern
'title_or_unix_name'
the page title ('title') if not empty, the unix name ('name') with first letter capitalized and dashes replaced by blanks otherwise
'parent_page'
the page's parent page; None if no parent page has been set
'user_created'
the name of the user who created the page
'date_created'
date and time when the page was created; format YYYY-MM-DDThh:mm:ss+timezone1
'user_edited'
the name of the user who last edited the page; None if the page is at revision 0
'date_edited'
date and time when the page was last edited; the 'date_created' date/time if the page is at revision 0; format YYYY-MM-DDThh:mm:ss+timezone2
'tag_array'
a list of tags the page is tagged with
'tag_string'
a string of blank-separated tags the page is tagged with

Example

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

What you type … What you get …

s.page.get({'site': 'community', 'page': 'admin:manage'})

{'source': '[[module ManageSite ]]\n\n[!-- \nPlease do not modify this page.\n--]',
 'html': '',
 'meta':
 {'category': 'admin',
  'user_edited': None,
  'tag_array': [],
  'name': 'manage',
  'title': 'Manage Site',
  'tag_string': '',
  'title_shown': 'Manage Site',
  'site': 'community',
  'title_or_unix_name': 'Manage Site',
  'parent_page': None,
  'full_name': 'admin:manage',
  'user_created': 'michal frackowiak',
  'date_created': '2006-08-01T01:35:46+00:00',
  'date_edited': '2006-08-01T01:35:46+00:00'
 }
}

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