Source for file examples.guifi_api.misc.php
Documentation is available at examples.guifi_api.misc.php
-
-
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
-
// Eduard Duran <eduard.duran at iglu.cat>.
-
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
-
// You can get copies of the licenses here:
-
// http://www.affero.org/oagpl.html
-
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "LICENSE.txt".
-
-
require ( 'guifi_api.php' );
-
-
-
* Configuration of authentication against guifi.net
-
-
-
-
-
-
-
-
$gapi = new guifiAPI( $username, $password );
-
-
$action = $_GET['action'];
-
-
-
-
-
-
$model['supported'] = 'Yes';
-
-
$models = $gapi->getModels( $model );
-
-
-
foreach( $models as $model ) {
-
-
-
echo "<li>Model ID: $model->mid</li>";
-
echo "<li>Manufacturer ID: $model->fid</li>";
-
echo "<li>Model: $model->model</li>";
-
echo "<li>Type: $model->type</li>";
-
echo "<li>Supported: $model->supported</li>";
-
-
-
-
-
-
echo "There was an error getting the models.<br />\n";
-
echo $gapi->getErrorsStr();
-
-
-
-
$manufacturers = $gapi->getManufacturers();
-
-
-
foreach( $manufacturers as $manufacturer ) {
-
-
-
echo "<li>Manufacturer ID: $manufacturer->fid</li>";
-
echo "<li>Name: $manufacturer->name</li>";
-
echo "<li>URL: $manufacturer->url</li>";
-
-
-
-
-
-
echo "There was an error getting the manufacturers.<br />\n";
-
echo $gapi->getErrorsStr();
-
-
-
-
-
$firmware['model_id'] = 27; // RB600
-
-
-
$firmwares = $gapi->getFirmwares( $firmware );
-
-
-
foreach( $firmwares as $firmware ) {
-
-
-
echo "<li>Title: $firmware->title</li>";
-
echo "<li>Description: $firmware->description</li>";
-
-
-
-
-
-
echo "There was an error getting the firmwares.<br />\n";
-
echo $gapi->getErrorsStr();
-
-
-
-
$protocols = $gapi->getProtocols();
-
-
-
foreach( $protocols as $protocol ) {
-
-
-
echo "<li>Title: $protocol->title</li>";
-
echo "<li>Description: $protocol->description</li>";
-
-
-
-
-
-
echo "There was an error getting the protocols.<br />\n";
-
echo $gapi->getErrorsStr();
-
-
-
-
-
$channels = $gapi->getChannels($protocol);
-
-
-
foreach( $channels as $channel ) {
-
-
-
echo "<li>Title: $channel->title</li>";
-
echo "<li>Description: $channel->description</li>";
-
-
-
-
-
-
echo "There was an error getting the channels.<br />\n";
-
echo $gapi->getErrorsStr();
-
-
-
-
-
|