41 lines
864 B
Perl
Executable File
41 lines
864 B
Perl
Executable File
#!/bin/env perl
|
|
|
|
# Raw uri https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=VBU.TO&apikey=EC4C0NRKZAK1Q2UG
|
|
use strict;
|
|
use warnings;
|
|
use HTTP::Request;
|
|
|
|
my $api_uri = "https://www.alphavantage.co/";
|
|
my $api_key = "EC4C0NRKZAK1Q2UG";
|
|
|
|
my @symbols =
|
|
(
|
|
"VIU.TO",
|
|
"VCN.TO",
|
|
"VUN.TO"
|
|
);
|
|
|
|
my %functions =
|
|
(
|
|
"timeseries_intraday", "TIME_SERIES_INTRADAY",
|
|
"timeseries_daily", "TIME_SERIES_DAILY",
|
|
"timeseries_daily_adj", "TIME_SERIES_DAILY_ADJUSTED",
|
|
"timeseries_weekly", "TIME_SERIES_WEEKLY",
|
|
"timeseries_weekly_adj", "TIME_SERIES_WEEKLY_ADJUSTED",
|
|
"timeseries_monthly", "TIME_SERIES_MONTHLY",
|
|
"timeseries_monthly_adj", "TIME_SERIES_MONTHLY_ADJUSTED"
|
|
);
|
|
|
|
foreach my $stock_symbol (@symbols)
|
|
{
|
|
print $api_uri,
|
|
"query?".
|
|
"function=",
|
|
$functions{'timeseries_daily'},
|
|
"&symbol=",
|
|
$stock_symbol,
|
|
"&apikey=",
|
|
$api_key,
|
|
"\n";
|
|
}
|