Add Crypto-Bridge ticker API

This commit is contained in:
Brian Ziemek 2018-03-18 02:48:18 -04:00 committed by GitHub
parent 8f33ceb3a4
commit 0dbb4d8bc9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,6 +85,8 @@ class Tools extends Base {
return 'c-cex';
} else if (preg_match('/bittrex.com/', $url)) {
return 'bittrex';
} else if (preg_match('/crypto-bridge.org/', $url)) {
return 'cryptobridge';
}
$this->setErrorMessage("API URL unknown");
return false;
@ -127,6 +129,11 @@ class Tools extends Base {
case 'bittrex':
return @$aData['result']['Last'];
break;
case 'cryptobridge':
foreach ($aData as $aItem) {
if("{$strBase}_{$strQuote}" == $aItem['id'])
return $aItem['last'];
}
}
} else {
$this->setErrorMessage("Got an invalid response from ticker API");