Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add INST_ID as optional parameter to XETRA, Tradegate and Sinvestor #308

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

mumpitzstuff
Copy link
Contributor

@mumpitzstuff mumpitzstuff commented Jun 26, 2023

Behaviour is exactly the same if no INST_ID is provided as parameter. This means the user can use the institute id but does not have to.

@bpschuck
Copy link
Contributor

I'm thinking this would be easier to just map the INST_ID to the method. Much like many modules may map 'nyse' to their native method such as yahooweb or alphavantage.

@mumpitzstuff
Copy link
Contributor Author

Hmm i really have no idea how it should work. I do not want to provide hardcoded institute ids because they may change in the future. Therefore i would prefer an optional parameter to let the users decide if they want to use the default institute (SParkasse Krefeld) or any other institute like Sparkasse München).
If you really think that a method should be used please provide a pseudocode example how such a call would look like.

@bpschuck
Copy link
Contributor

Ignore that.
Does the error message returned in $@ contain useful information if the fetch was called with a non-existing INST_ID?

@bpschuck
Copy link
Contributor

@mumpitzstuff
I wrote a quick test script to see what the error may contain if given an invalid INST_ID.

#!/usr/bin/perl
# vi: set ts=2 sw=2 noai ic showmode showmatch: 

use Finance::Quote;

my $q = Finance::Quote->new('XETRA', 'xetra' => {INST_ID => '0099903'});

my %info = $q->fetch('xetra', 'NL0000009165');

foreach $key (keys %info) {
  $value = $info{$key};
  print "$key: $value\n";
}

When executed it returns:

NL0000009165errormsg: Error retreiving NL0000009165: Can't call method "look_down" on an undefined value at /home/bschuck/tmp/finance-quote/lib/Finance/Quote/XETRA.pm line 75.

NL0000009165success: 0

In my opinion it would be more useful to catch the error from the initial fetch, or in this case that the initial call to TreeBuilder failed because the URL contained a non-existent/invalid INST_ID.

@bpschuck bpschuck self-assigned this Jun 28, 2023
@bpschuck bpschuck added modified scraping scraping modified mostly to follow website modifications enhancement discussions about new features / enhancements of code labels Jun 28, 2023
@mumpitzstuff
Copy link
Contributor Author

Its a valid finding. I added something to catch such an error...

@bpschuck
Copy link
Contributor

Cool, thanks. I see you also added where one can find a list of the INST_ID to the various PODs. Thanks for that detail.

@bpschuck bpschuck merged commit b85dd51 into finance-quote:master Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement discussions about new features / enhancements of code modified scraping scraping modified mostly to follow website modifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants