gnucash/bindings/python/example_scripts/get_quotes.pl
Geert Janssens 15a35e6a3b Housekeeping - replace plenty of http links with https
There are more, but these are most common ones.
There are also a number of urls that don't behave well when https, so those are skipped
At some point I have also started marking non-working URLs as [DEAD LINK], though
that's not a full coverage.
2019-06-06 15:52:30 +02:00

42 lines
1.1 KiB
Perl

#!/usr/bin/perl -w
# get_quotes.pl -- Addition to example Script quotes_historc.py. Reads online stock quotes to file INTC.
#
## @file
# @brief Addition to example Script quotes_historic.py. Reads online stock quotes to file INTC.
# @author Peter Holtermann
# @date January 2011
# @ingroup python_bindings_examples
#
# Call this script before calling @code
# python quotes_historic.py
# @endcode
#
# For explanation of use have a look at the wiki:
# https://wiki.gnucash.org/wiki/Stocks/get_prices
#
# @cond PERL
use Finance::QuoteHist;
print "Will get stock quotes of $ARGV[0] and save it into the file $ARGV[0]\n";
$fname = $ARGV[0];
open (MYFILE, ">$fname");
$q = Finance::QuoteHist->new
(
symbols => [($ARGV[0])],
start_date => '01/01/2000',
end_date => 'today',
);
print "name,date, open, high, low, close, volume\n";
foreach $row ($q->quotes()) {
($name,$date, $open, $high, $low, $close, $volume) = @$row;
print MYFILE "$name,$date, $open, $high, $low, $close, $volume\n";
}
close(MYFILE);
## @endcond