You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
864 B
41 lines
864 B
4 years ago
|
#!/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";
|
||
|
}
|