/**
  * Returns the Neostrada class instance and creates it if needed
  */
 public static function GetInstance()
 {
     if (self::$Instance === NULL) {
         self::$Instance = new Neostrada();
     }
     return self::$Instance;
 }
Ejemplo n.º 2
0
 public function APICall()
 {
     $Error = '';
     $API = Neostrada::GetInstance();
     /**
      * Your API information can be found after logging in to the website
      */
     $API->SetAPIKey('[API_Key]');
     $API->SetAPISecret('[API_Secret]');
     /**
      * Get all extensions from our website
      */
     $API->prepare('extensions');
     $API->execute();
     $Result = $API->fetch();
     /**
      * Check if you have calls left
      */
     if ($Result['code'] == 429) {
         $Error = '<div class="error">Too Many Requests</div>';
     } elseif ($Result['code'] == 540) {
         $Error = '<div class="error">Invalid API Key or Secret</div>';
     }
     $CountResult = count($Result['extensions']);
     $GetExtenions = $this->GetExtensions($CountResult, $Result);
     return array($Error, $API, $Result, $CountResult, $GetExtenions);
 }
Ejemplo n.º 3
0
<?php

/**
 * Include API library
 */
require_once dirname(__FILE__) . '/../Client/Neostrada.inc.php';
/**
 * Ininitalize the Neostrada API client
 */
$API = Neostrada::GetInstance();
$API->SetAPIKey('[your_apikey]');
$API->SetAPISecret('[your_apisecret]');
/**
 * Get domains
 */
$API->prepare('domains');
$API->execute();
echo '<pre>';
print_r($API->fetch());
/**
 * Get extensions
 */
$API->prepare('extensions');
$API->execute();
print_r($API->fetch());
/**
 * Do whois
 */
$API->prepare('whois', array('domain' => 'my-domainname', 'extension' => 'nl'));
$API->execute();
print_r($API->fetch());