getquoteView |
---|
60 | 60 | return '$' . $ticker->{last}; |
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | | - if ($symbol eq 'ETH') { |
65 | | - if (my $ticker = json_req('https://poloniex.com/public?command=returnTicker')) { |
66 | | - return '$' . $ticker->{USDT_ETH}->{last}; |
67 | | - } |
68 | | - } |
69 | | - |
70 | 64 | my %coinabul_markets = ( |
71 | 65 | AU => 'Gold', |
72 | 66 | AG => 'Silver', |
73 | 67 | ); |
74 | 68 | |
75 | | - my %cryptotrade_markets = ( |
76 | | - CTB => 'BTC', |
77 | | - CTL => 'LTC', |
78 | | - ESB => 'BTC', |
79 | | - ESL => 'LTC', |
80 | | - GGB => 'BTC', |
| 69 | + my %poloniex_markets = ( |
| 70 | + ETH => 'USDT', |
81 | 71 | PPC => 'BTC', |
82 | | - LTC => 'BTC', |
| 72 | + LTC => 'USDT', |
| 73 | + XPM => 'BTC', |
83 | 74 | NMC => 'BTC', |
84 | | - XPM => 'BTC', |
85 | | - FTC => 'BTC', |
86 | 75 | ); |
87 | 76 | |
88 | 77 | my %cryptostocks_markets = ( |
89 | 78 | BTCINVEST => 1, |
104 | 93 | '€' => 'EUR', |
105 | 94 | EUR => 1 |
106 | 95 | ); |
107 | 96 | |
| 97 | + if (my $base = $poloniex_markets{$symbol}) { |
| 98 | + my $ticker = $base . '_' . $symbol; |
| 99 | + if (my $market = json_req('https://poloniex.com/public?command=returnTicker')) { |
| 100 | + my $amount = $market->{$ticker}->{last}; |
| 101 | + return $base eq 'USDT' ? '$' . $amount : $amount . ' ' . $base; |
| 102 | + } |
| 103 | + } |
| 104 | + |
108 | 105 | if (my $marketid = $coinabul_markets{$symbol}) { |
109 | 106 | if (my $market = json_req('http://coinabul.com/api.php')) { |
110 | 107 | return '$' . $market->{$marketid}->{USD}; |
111 | 108 | } |
112 | 109 | } |
113 | 110 | |
114 | | - if (my $currency = $cryptotrade_markets{$symbol}) { |
115 | | - my $ticker = lc($symbol . '_' . $currency); |
116 | | - my $resp = json_req('https://crypto-trade.com/api/1/ticker/' . $ticker); |
117 | | - if ($resp and $resp->{status} eq 'success') { |
118 | | - my $data = $resp->{data}; |
119 | | - my $price = $data->{last} || |
120 | | - ($data->{min_ask} + $data->{max_bid}) / 2; |
121 | | - return $price . ' ' . $currency; |
122 | | - } |
123 | | - } |
124 | | - |
125 | 111 | if ($cryptostocks_markets{$symbol}) { |
126 | 112 | if (my $info = json_req('https://cryptostocks.com/api/get_security_info.json?ticker=' . $symbol)) { |
127 | 113 | if ($info and $info->{return_code} == 0) { |
128 | 114 | return $info->{last_price} . ' ' . $info->{currency}; |