-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestMemento.php
More file actions
22 lines (22 loc) · 1.04 KB
/
testMemento.php
File metadata and controls
22 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
require_once('vendor/autoload.php');
require 'src/MementoApi.php';
$vApi = new \BtcRelax\MementoApi('memento.fastfen.club', 8080);
$vResult = $vApi->getLibraries();
echo \sprintf("Result of getLibraries:<font color='red'>%s</font>\n<br>", $vResult ? 'true': 'false');
echo \sprintf("Result of getLastError:<font color='red'>%s</font>\n<br>", $vApi->getLastError());
$vUser = $_GET["user"];
$vPass = $_GET["pass"];
$vResult = $vApi->init($vUser, $vPass);
if ($vResult) {
$vSess = $vApi->getSession();
echo \sprintf("All Ok! \n<br> Session:%s\n<br>", $vSess);
$vResult = $vApi->getLibraries();
echo \sprintf("Result of getLibraries:<font color='red'>%s</font>\n<br>", $vResult ? 'true': 'false');
echo \sprintf("Result of getLastError:<font color='red'>%s</font>\n<br>", $vApi->getLastError());
$vLibList = $vApi->getLibraiesList();
foreach ($vLibList as $lib) {
$vLibInf = \sprintf("<p>Owner: %s \n LibTitle: %s \n UUID: %s \n</p>", $lib["owner"], $lib["model"]["title"], $lib["model"]["uuid"]);
echo($vLibInf);
}
};