pre-horizon

This commit is contained in:
2019-09-28 23:54:46 -05:00
parent 10ad11d956
commit 561d1cf453
11 changed files with 372 additions and 86 deletions
-80
View File
@@ -43,86 +43,6 @@ class Esi {
}
}
public function GetCharacterData($charId) {
$esi = new Eseye();
try {
$character = $esi->invoke('get', '/characters/{character_id}/', [
'character_id' => $charId,
]);
} catch(RequestFailedException $e) {
return null;
}
return $character;
}
public function GetCharacterName($charId) {
$esi = new Eseye();
try {
$character = $esi->invoke('get', '/characters/{character_id}/', [
'character_id' => $charId,
]);
} catch(RequestFailedException $e) {
return null;
}
return $character->name;
}
public function FindCharacterId($name) {
$config = config('esi');
//Create the esi authentication container
$authentication = new EsiAuthentication([
'client_id' => $config['client_id'],
'secret' => $config['secret'],
]);
//Create the esi container
$esi = new Eseye($authentication);
try {
$character = $esi->setQueryString([
'categories' => 'character',
'language' => 'en-us',
'search' => $name,
'strict' => 'true',
])->invoke('get', '/search/');
} catch(RequestFailedException $e) {
return null;
}
$character = json_decode($character, true);
return $character['character'];
}
public function FindCorporationId($charId) {
$esi = new Eseye();
try {
$character = $esi->invoke('get', '/characters/{character_id}/', [
'character_id' => $charId,
]);
} catch(RequestFailedException $e) {
return null;
}
return $character->corporation_id;
}
public function FindCorporationName($charId) {
$esi = new Eseye();
try {
$character = $esi->invoke('get', '/characters/{character_id}/', [
'character_id' => $charId,
]);
$corporation = $esi->invoke('get', '/corporations/{corporation_id}/', [
'corporation_id' => $character->corporation_id,
]);
} catch(RequestFailedException $e) {
return null;
}
return $corporation->name;
}
public function DecodeDate($date) {
//Find the end of the date
$dateEnd = strpos($date, "T");