|
|
@ -123,11 +123,11 @@ int32_t main(int32_t argc,char **argv) |
|
|
|
{ |
|
|
|
cJSON *pjson,*bpi,*usd; |
|
|
|
printf("Powered by CoinDesk (%s)\n","https://www.coindesk.com/price/"); |
|
|
|
if ( (pjson= get_urljson("http://api.coindesk.com/v1/bpi/currentprice.json","")) != 0 ) |
|
|
|
if ( (pjson= get_urljson("http://api.coindesk.com/v1/bpi/currentprice.json")) != 0 ) |
|
|
|
{ |
|
|
|
if ( (bpi= jobj(pjson,"bpi")) != 0 && (usd= jobj(bpi,"USD")) != 0 ) |
|
|
|
printf("BTC/USD %.4f\n",jdouble(usd,"rate_float")); |
|
|
|
json_free(pjson); |
|
|
|
free_json(pjson); |
|
|
|
} |
|
|
|
return(0); |
|
|
|
} |
|
|
|