mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Restructure the src directory
It is split into - /libgnucash (for the non-gui bits) - /gnucash (for the gui) - /common (misc source files used by both) - /bindings (currently only holds python bindings) This is the first step in restructuring the code. It will need much more fine tuning later on.
This commit is contained in:
41
bindings/python/example_scripts/get_quotes.pl
Normal file
41
bindings/python/example_scripts/get_quotes.pl
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/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:
|
||||
# http://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
|
||||
Reference in New Issue
Block a user