Ryzom API/Guilds

From EncyclopAtys

Jump to: navigation, search
de:Ryzom API/Gilden en:Ryzom API/Guilds
 
UnderConstruction.png
Translation to review
Don't blame the contributors, but come and help them 😎

Reference text ( Maintained text, used as reference ) :
Notes: (Leda, 2023-05-27)

Displays the list of all guilds.

Usage

<base URL>/guilds.php

Cache Duration

Returned XML has <cache> element with attributes created and expire (utc timestamp)

XML structure

<guilds>
  <cache created="1387371064" expire="1387374664"/>
  <shard>atys</shard>
  <guild>
    <gid>105906182</gid>
    <name>Atrium</name>
    <race>Fyros</race>
    <icon>575080624687965565</icon>
    <creation_date>131736955</creation_date>
    <description>Here you are the Keeper, your destiny is to make the rules to be respected</description>
  </guild>
  <guild>
    ....
  </guild>
</guilds>

PHP interface

ryzom_guildlist_api()

Function returns SimpleXMLElement object on success or boolean false on error.

<?php
  require_once "ryzomapi_lite.php";

  $guilds = ryzom_guildlist_api();
  if ($guilds !== false) {
    echo '<pre>';
    foreach($guilds->guild as $guild) {
      $gid = (int)$guild->gid;
      $name = htmlspecialchars($guild->name);
      echo "{$gid} {$name}\n";
    }
    echo '</pre>';
  } else {
    echo "API failure";