Re: [GNC] ASX quotes not working again?

2020-12-21 Thread dullege
Yes - pretty sure both the ASX.pm and Cdnfundlibrary.pm currently in github are 
not working and there are fixed versions available. 


-Original Message-
From: Frank H. Ellenberger  
Sent: Monday, 21 December 2020 8:44 PM
To: Geoff ; dull...@gmail.com; 
gnucash-user@gnucash.org
Subject: Re: [GNC] ASX quotes not working again?

Hi Geoff,

Am 21.12.20 um 06:01 schrieb Geoff:
> I am time poor, but I hope to do a proper documented release of this 
> next year.
> 
> Regards
> 
> Geoff

important is to add it to https://github.com/finance-quote/finance-quote

Regards
Frank

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] ASX quotes not working again?

2020-12-21 Thread Frank H. Ellenberger
Hi Geoff,

Am 21.12.20 um 06:01 schrieb Geoff:
> I am time poor, but I hope to do a proper documented release of this
> next year.
> 
> Regards
> 
> Geoff

important is to add it to https://github.com/finance-quote/finance-quote

Regards
Frank
___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] ASX quotes not working again?

2020-12-20 Thread dullege
This looks to be working good - thanks so much for sending the file.

Regards,
Bill


-Original Message-
From: Geoff  
Sent: Monday, 21 December 2020 4:01 PM
To: dull...@gmail.com; gnucash-user@gnucash.org
Subject: Re: [GNC] ASX quotes not working again?

If you are comfortable accepting code from strangers on the internet, the 
attached version seems to be working for me.

C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump asx BHP Finance::Quote 
fields Gnucash uses:
 symbol: BHP  <=== required
   date: 12/21/2020   <=== recommended
   currency: AUD  <=== required
   last: 43.56<=\
nav:  <=== one of these
  price: 43.56<=/
   timezone:  <=== optional

C:\Program Files (x86)\gnucash\bin>

It also updates the price database - GnuCash 4.1 on Windows 10.


I am time poor, but I hope to do a proper documented release of this next year.

Regards

Geoff
=

On 21/12/2020 12:00 pm, dull...@gmail.com wrote:
> I note Australian stock exchange quotes are failing again.  I had a 
> fix from October . maybe they have changed their site again?
> 
>   
> 
> Using gnc-fq-dump seems to work fine .
> 
>   
> 
> C:\Program Files (x86)\gnucash\bin> perl gnc-fq-dump ASX IAG
> 
> Finance::Quote fields Gnucash uses:
> 
>  symbol: IAG  <=== required
> 
>date: 12/21/2020   <=== recommended
> 
>currency: AUD  <=== required
> 
>last: 4.885<=\
> 
> nav:  <=== one of these
> 
>   price: 4.885<=/
> 
>timezone:  <=== optional
> 
>   
> 
> But when updating in gnucash->Price Database->Get Quotes . gives an 
> error ("unable to retrieve quotes") for all ASX quotes.
> 
>   
> 
> Gnucash version 4.2, finance:quote version 1.49
> 
>   
> 
> Wondering if anyone has a working ASX.pm?
> 
>   
> 
>   
> 
>   
> 
> ___
> gnucash-user mailing list
> gnucash-user@gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see 
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
> 

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.


Re: [GNC] ASX quotes not working again?

2020-12-20 Thread Geoff
If you are comfortable accepting code from strangers on the internet, 
the attached version seems to be working for me.


C:\Program Files (x86)\gnucash\bin>perl gnc-fq-dump asx BHP
Finance::Quote fields Gnucash uses:
symbol: BHP  <=== required
  date: 12/21/2020   <=== recommended
  currency: AUD  <=== required
  last: 43.56<=\
   nav:  <=== one of these
 price: 43.56<=/
  timezone:  <=== optional

C:\Program Files (x86)\gnucash\bin>

It also updates the price database - GnuCash 4.1 on Windows 10.


I am time poor, but I hope to do a proper documented release of this 
next year.


Regards

Geoff
=

On 21/12/2020 12:00 pm, dull...@gmail.com wrote:

I note Australian stock exchange quotes are failing again.  I had a fix from
October . maybe they have changed their site again?

  


Using gnc-fq-dump seems to work fine .

  


C:\Program Files (x86)\gnucash\bin> perl gnc-fq-dump ASX IAG

Finance::Quote fields Gnucash uses:

 symbol: IAG  <=== required

   date: 12/21/2020   <=== recommended

   currency: AUD  <=== required

   last: 4.885<=\

nav:  <=== one of these

  price: 4.885<=/

   timezone:  <=== optional

  


But when updating in gnucash->Price Database->Get Quotes . gives an error
("unable to retrieve quotes") for all ASX quotes.

  


Gnucash version 4.2, finance:quote version 1.49

  


Wondering if anyone has a working ASX.pm?

  

  

  


___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

#!/usr/bin/perl -w
#
#Copyright (C) 1998, Dj Padzensky 
#Copyright (C) 1998, 1999 Linas Vepstas 
#Copyright (C) 2000, Yannick LE NY 
#Copyright (C) 2000, Brent Neal 
#Copyright (C) 2001, Leigh Wedding 
#Copyright (C) 2000-2004, Paul Fenwick 
#Copyright (C) 2014, Chris Good 
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
#02110-1301, USA
#
#
# This code derived from Padzensky's work on package Finance::YahooQuote,
# but extends its capabilites to encompas a greater number of data sources.
#
# This code was developed as part of GnuCash 

require 5.005;

use strict;
use warnings;

package Finance::Quote::ASX;

use LWP::UserAgent;
use JSON qw/decode_json/;

use vars qw/$ASX_URL $ASX_URL_FALLBACK/;

# VERSION

$ASX_URL = 'https://www.asx.com.au/asx/1/share';
$ASX_URL_FALLBACK =
'https://asx.api.markitdigital.com/asx-research/1.0/companies';


sub methods {return (australia => \,asx => \)}

{
my @labels = qw/
last
net
p_change
bid
offer
open
close
high
low
volume
price
method
exchange/;

sub labels { return (australia => \@labels,
 asx   => \@labels); }
}

# Australian Stock Exchange (ASX)
# The ASX provides free delayed quotes through their webpage.
#
# Maintainer of this section is Paul Fenwick 
# 5-May-2001 Updated by Leigh Wedding 
# 24-Feb-2014 Updated by Chris Good 
# 12-Oct-2020 Updated by Jeremy Volkening

sub asx {

my $quoter = shift;
my @symbols = @_
or return;

my %info;

my $ua = $quoter->user_agent;

SYMBOL:
for my $symbol (@symbols) {

# there are multiple endpoints returning JSON data on a security. The
# primary endpoint returns the most readily-consumable data and works
# for most securities, so try that first

my $res = $ua->get(
join( '/', $ASX_URL, $symbol),
'Accept' => 'application/json'
);
if ($res->is_success && $res->header('content-type') =~ 
/application\/json/) {
my $data = decode_json( $res->content );
$info{ $symbol, 'success'  } = 1;

[GNC] ASX quotes not working again?

2020-12-20 Thread dullege
I note Australian stock exchange quotes are failing again.  I had a fix from
October . maybe they have changed their site again?

 

Using gnc-fq-dump seems to work fine . 

 

C:\Program Files (x86)\gnucash\bin> perl gnc-fq-dump ASX IAG

Finance::Quote fields Gnucash uses:

symbol: IAG  <=== required

  date: 12/21/2020   <=== recommended

  currency: AUD  <=== required

  last: 4.885<=\

   nav:  <=== one of these

 price: 4.885<=/

  timezone:  <=== optional

 

But when updating in gnucash->Price Database->Get Quotes . gives an error
("unable to retrieve quotes") for all ASX quotes.

 

Gnucash version 4.2, finance:quote version 1.49

 

Wondering if anyone has a working ASX.pm?

 

 

 

___
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.