Closed f100001e closed 5 months ago
Closing this due to lack of response. This may also be a wordpress issue instead of the plugin issue.
Problem solved. It was a PHP issue.
On Jun 7, 2024, at 11:58 PM, AlphaVantageSupport @.***> wrote:
Closing this due to lack of response. This may also be a wordpress issue instead of the plugin issue.
— Reply to this email directly, view it on GitHub https://github.com/RomelTorres/alpha_vantage/issues/365#issuecomment-2155844771, or unsubscribe https://github.com/notifications/unsubscribe-auth/BE3ZZMIZPOTU6DXVRNIL7NLZGKTTBAVCNFSM6AAAAABH5VRZESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVHA2DINZXGE. You are receiving this because you authored the thread.
Trying to pay my bill
On Jun 7, 2024, at 11:58 PM, AlphaVantageSupport @.***> wrote:
Closing this due to lack of response. This may also be a wordpress issue instead of the plugin issue.
— Reply to this email directly, view it on GitHub https://github.com/RomelTorres/alpha_vantage/issues/365#issuecomment-2155844771, or unsubscribe https://github.com/notifications/unsubscribe-auth/BE3ZZMIZPOTU6DXVRNIL7NLZGKTTBAVCNFSM6AAAAABH5VRZESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJVHA2DINZXGE. You are receiving this because you authored the thread.
`<?php $apiKey = 'API Key';
function callStockdataAPI($symbol, $apiKey) { $endpoint = 'https://www.alphavantage.co/query'; $params = [ 'function' => 'TIME_SERIES_DAILY_ADJUSTED', 'symbol' => $symbol, 'apikey' => $apiKey ];
}
function callCryptodataAPI($symbol, $apiKey) { $endpoint = 'https://www.alphavantage.co/query'; $params = [ 'function' => 'DIGITAL_CURRENCY_DAILY', 'symbol' => $symbol, 'market' => 'USD', 'apikey' => $apiKey ];
}
$data = []; $symbols = [ 'GOOG', 'AAPL', 'TSLA', 'META', 'AMZN', 'NFLX', 'GME', 'AMC', 'NOK', 'TSM', 'BLK', 'BTC', 'ETH', 'XRP' ];
foreach ($symbols as $symbol) { if (strpos($symbol, 'BTC') !== false || strpos($symbol, 'ETH') !== false || strpos($symbol, 'XRP') !== false) { $data[] = callCryptodataAPI($symbol, $apiKey); } else { $data[] = callStockdataAPI($symbol, $apiKey); } }
if (!empty($data)) { $stockTickerText = implode(" ", $data); } else { $stockTickerText = "No data available"; } ?>
<!DOCTYPE html>
`