Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
token
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wallet
token
Commits
21f3b6a7
Commit
21f3b6a7
authored
Apr 03, 2019
by
shajiaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
385d80db
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
11 deletions
+12
-11
Bitfinex.php
common/service/exchange/Bitfinex.php
+3
-2
Bittrex.php
common/service/exchange/Bittrex.php
+1
-1
Bty.php
common/service/exchange/Bty.php
+1
-1
Hadax.php
common/service/exchange/Hadax.php
+1
-1
HuoBi.php
common/service/exchange/HuoBi.php
+3
-3
Token7.php
common/service/exchange/Token7.php
+1
-1
Zb.php
common/service/exchange/Zb.php
+2
-2
No files found.
common/service/exchange/Bitfinex.php
View file @
21f3b6a7
...
@@ -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
;
}
}
...
...
common/service/exchange/Bittrex.php
View file @
21f3b6a7
...
@@ -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
)
{
...
...
common/service/exchange/Bty.php
View file @
21f3b6a7
...
@@ -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
)
{
...
...
common/service/exchange/Hadax.php
View file @
21f3b6a7
...
@@ -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
)
{
...
...
common/service/exchange/HuoBi.php
View file @
21f3b6a7
...
@@ -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'
];
...
...
common/service/exchange/Token7.php
View file @
21f3b6a7
...
@@ -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
)
{
...
...
common/service/exchange/Zb.php
View file @
21f3b6a7
...
@@ -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'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment