File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 5
5
6
6
$ curl = new Curl ();
7
7
$ curl ->setHeader ('CB-VERSION ' , '2016-01-01 ' );
8
- $ curl ->get ('https://api.coinbase.com/v2/prices/spot ' );
8
+ $ curl ->get ('https://api.coinbase.com/v2/prices/BTC-USD/ spot ' );
9
9
10
10
echo
11
- 'The current price of bitcoin at Coinbase is ' .
11
+ 'The current price of BTC at Coinbase is ' .
12
12
'$ ' . $ curl ->response ->data ->amount . ' ' . $ curl ->response ->data ->currency . '. ' . "\n" ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+ require __DIR__ . '/vendor/autoload.php ' ;
3
+
4
+ use \Curl \Curl ;
5
+
6
+ $ curl = new Curl ();
7
+ $ curl ->setHeader ('CB-VERSION ' , '2016-01-01 ' );
8
+ $ curl ->get ('https://api.coinbase.com/v2/prices/ETH-USD/spot ' );
9
+
10
+ echo
11
+ 'The current price of ETH at Coinbase is ' .
12
+ '$ ' . $ curl ->response ->data ->amount . ' ' . $ curl ->response ->data ->currency . '. ' . "\n" ;
You can’t perform that action at this time.
0 commit comments