Skip to content

Commit

Permalink
Add Crypto-Bridge ticker API
Browse files Browse the repository at this point in the history
  • Loading branch information
bziemek authored Mar 18, 2018
1 parent 8f33ceb commit 0dbb4d8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/classes/tools.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ private function getApiType($url) {
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;
Expand Down Expand Up @@ -127,6 +129,11 @@ public function getPrice() {
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");
Expand Down

0 comments on commit 0dbb4d8

Please sign in to comment.