Get a bunch of pages and returns (some of) their meta data
argument keys:

  • site: site to list pages from, eg. "my-site"
  • pages: list of page full names to list (maximum 10 pages)

returns: dictionary of pages. For each page there will be item in the dictionary with page name as key and dictionary of the following page properties as value:

  • fullname
  • created_at
  • created_by
  • updated_at
  • updated_by
  • title
  • parent_fullname
  • tags: list of all tags (including those starting with underscore)
  • rating
  • revisions
  • [PLANNED] comments: number of comments
  • [PLANNED] files: number of files attached to the page
  • [PLANNED] children: number of children pages

This pages.get_meta demo uses the sample code below. Create a separate file in your hosted site. Change the path to the and files. Add files to get in the $Files array. Replace the all caps USERNAME, API KEY, and SITENAME with values specific to you and your site.

Sample Code

//set globals before includes
    $newdebuglevel = 0;    
//add includes
//change path to your server location
//set startup parameters for xmlrpc
//change path to your server location
    $GLOBALS ['xmlrpc_null_extension' ] = true;
    $ServerPath = "xml-rpc-api.php";
    $ServerHostName = "";
    $ServerPort = "";
//create a client for your site
    $Client = new xmlrpc_client($ServerPath,$ServerHostName,$ServerPort);
    $Client->setCredentials("USERNAME","API KEY");
    $Client->return_type = "phpvals"; //forces return of page.get_one as php values
    $SiteName = "SITENAME";
////////////test code
////////////code doesn't include error checking
    $metaobj = new WikidotMeta($SiteName, $Client);
    $returnarray = array();
    echo "<h3>pages.get_meta example</h3></br><hr>";
    $metaobj->php_pages_get_meta($Files, $returnarray);
    foreach($returnarray as $filear){
        foreach($filear as $key=>$data){
            if($key == "tags"){
                foreach($data as $tag) echo $key.":tag=> ".$tag."</br>";}
            else echo $key.": ".$data."</br>";}
        echo "</br><hr></br>";}

Download Code File

Live demo

Uses above code in an Iframe from a PHP host.

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