Commit 21f3b6a7 authored by shajiaiming's avatar shajiaiming

fix

parent 385d80db
...@@ -33,7 +33,7 @@ class Bitfinex extends Exchange implements ExchangeInterface ...@@ -33,7 +33,7 @@ class Bitfinex extends Exchange implements ExchangeInterface
public function setSupportedSymbol() public function setSupportedSymbol()
{ {
$curl = new Curl(); $curl = new Curl();
$result = $curl->get('https://api.bitfinex.com/v1/symbols'); $result = $curl->get('https://api.bitfinex.com/v1/symbols', false);
if ($result) { if ($result) {
foreach ($result as $item) { foreach ($result as $item) {
$this->redis->sadd($this->supported_symbol, 't' . strtoupper($item)); $this->redis->sadd($this->supported_symbol, 't' . strtoupper($item));
...@@ -46,7 +46,8 @@ class Bitfinex extends Exchange implements ExchangeInterface ...@@ -46,7 +46,8 @@ class Bitfinex extends Exchange implements ExchangeInterface
$symbols = $this->redis->smembers($this->supported_symbol); $symbols = $this->redis->smembers($this->supported_symbol);
$query = '?symbols=' . implode(',', $symbols); $query = '?symbols=' . implode(',', $symbols);
$curl = new Curl(); $curl = new Curl();
$res = $curl->get('https://api.bitfinex.com/v2/tickers' . $query); $res = $curl->get('https://api.bitfinex.com/v2/tickers' . $query, false);
if(false == $res){ if(false == $res){
return; return;
} }
......
...@@ -25,7 +25,7 @@ class Bittrex extends Exchange implements ExchangeInterface ...@@ -25,7 +25,7 @@ class Bittrex extends Exchange implements ExchangeInterface
{ {
$api = 'https://bittrex.com/api/v1.1/public/getmarkets'; $api = 'https://bittrex.com/api/v1.1/public/getmarkets';
$curl = new Curl(); $curl = new Curl();
$rev = $curl->get($api); $rev = $curl->get($api, false);
if ($rev && $rev['success']) { if ($rev && $rev['success']) {
$lists = $rev['result']; $lists = $rev['result'];
foreach ($lists as $item) { foreach ($lists as $item) {
......
...@@ -48,7 +48,7 @@ class Bty extends Exchange implements ExchangeInterface ...@@ -48,7 +48,7 @@ class Bty extends Exchange implements ExchangeInterface
$platforms = ['HKJB', 'BB360']; $platforms = ['HKJB', 'BB360'];
$curl = new Curl(); $curl = new Curl();
foreach($platforms as $platform) { foreach($platforms as $platform) {
$content = $curl->get($this->base_url . $platform); $content = $curl->get($this->base_url . $platform, false);
if (is_array($content) && isset($content['code']) && $content['code'] == 200) { if (is_array($content) && isset($content['code']) && $content['code'] == 200) {
$data = $content['data']['USDT']; $data = $content['data']['USDT'];
foreach ($data as $item) { foreach ($data as $item) {
......
...@@ -21,7 +21,7 @@ class Hadax extends HuoBi ...@@ -21,7 +21,7 @@ class Hadax extends HuoBi
{ {
$curl = new Curl(); $curl = new Curl();
$api = $this->base_url . '/v1/hadax/common/symbols'; $api = $this->base_url . '/v1/hadax/common/symbols';
$res = $curl->get($api);//json $res = $curl->get($api, false);//json
if ($res && $res['status'] == 'ok') { if ($res && $res['status'] == 'ok') {
$data = $res['data']; $data = $res['data'];
foreach ($data as $item) { foreach ($data as $item) {
......
...@@ -24,9 +24,9 @@ class HuoBi extends Exchange implements ExchangeInterface ...@@ -24,9 +24,9 @@ class HuoBi extends Exchange implements ExchangeInterface
public function setSupportedSymbol() public function setSupportedSymbol()
{ {
$api = $this->base_url . '/v1/common/symbols';
$curl = new Curl(); $curl = new Curl();
$res = $curl->get($api);//json $api = $this->base_url . '/v1/common/symbols';
$res = $curl->get($api, false);//json
if ($res && $res['status'] == 'ok') { if ($res && $res['status'] == 'ok') {
$data = $res['data']; $data = $res['data'];
foreach ($data as $item) { foreach ($data as $item) {
...@@ -38,8 +38,8 @@ class HuoBi extends Exchange implements ExchangeInterface ...@@ -38,8 +38,8 @@ class HuoBi extends Exchange implements ExchangeInterface
public function setQuotation() public function setQuotation()
{ {
$api = $this->base_url . '/market/tickers';
$curl = new Curl(); $curl = new Curl();
$api = $this->base_url . '/market/tickers';
$res = $curl->get($api, false); $res = $curl->get($api, false);
if ($res && $res['status'] == 'ok') { if ($res && $res['status'] == 'ok') {
$datas = $res['data']; $datas = $res['data'];
......
...@@ -55,7 +55,7 @@ class Token7 extends Exchange implements ExchangeInterface ...@@ -55,7 +55,7 @@ class Token7 extends Exchange implements ExchangeInterface
public function setQuotation() public function setQuotation()
{ {
$curl = new Curl(); $curl = new Curl();
$content = $curl->get($this->base_url); $content = $curl->get($this->base_url, false);
if (is_array($content) && isset($content['date']) && isset($content['ticker'])) { if (is_array($content) && isset($content['date']) && isset($content['ticker'])) {
$data = $content['ticker']; $data = $content['ticker'];
foreach ($data as $item) { foreach ($data as $item) {
......
...@@ -29,7 +29,7 @@ class Zb extends Exchange implements ExchangeInterface ...@@ -29,7 +29,7 @@ class Zb extends Exchange implements ExchangeInterface
{ {
$api = "http://api.zb.com/data/v1/markets"; $api = "http://api.zb.com/data/v1/markets";
$curl = new Curl(); $curl = new Curl();
$rev = $curl->get($api); $rev = $curl->get($api, false);
if ($rev) { if ($rev) {
$keys = array_keys($rev); $keys = array_keys($rev);
foreach ($keys as $key) { foreach ($keys as $key) {
...@@ -42,7 +42,7 @@ class Zb extends Exchange implements ExchangeInterface ...@@ -42,7 +42,7 @@ class Zb extends Exchange implements ExchangeInterface
{ {
$api = 'http://api.zb.com/data/v1/allTicker'; $api = 'http://api.zb.com/data/v1/allTicker';
$curl = new Curl(); $curl = new Curl();
$rev = $curl->get($api); $rev = $curl->get($api, false);
if ($rev) { if ($rev) {
foreach ($rev as $key => $item) { foreach ($rev as $key => $item) {
$this->redis->hmset($this->quotation_prefix . $key, 'low', $item['low'], 'high', $item['high'], 'last', $this->redis->hmset($this->quotation_prefix . $key, 'low', $item['low'], 'high', $item['high'], 'last',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment