http://www.perlmonks.org?node_id=131783


in reply to Re: Re: Yahoo Currency Exchange Interface
in thread Yahoo Currency Exchange Interface

Is this somehow wrong?
I'd qualify it as a waste of effort.

Use the CPAN.

Use the CPAN.

Look in the CPAN first.

If what you want to use isn't working, contribute a fix.

If what you want truly doesn't exist, then go ahead and write it.

If you have that many spare cycles that you want to write it from scratch even when a perfectly fine version exists in the CPAN, please contact me, I've got dozens of interesting projects for you to work on instead.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Re: Re: Yahoo Currency Exchange Interface
by cacharbe (Curate) on Dec 14, 2001 at 02:05 UTC
    Lastly, because pjf, in all his glory, is parsing HTML by hand in his Finance Packages with regards to Yahoo (and if Yahoo changes the output *BAM*), instead of using the raw CSV generator, which I describe in my notes.

    While I am trying to find the time to offer a re-write to him, I'm figuring out how best to do that by using it in implementations like this.

    C-.

      Lastly, because pjf, in all his glory, is parsing HTML by hand in his Finance Packages with regards to Yahoo (and if Yahoo changes the output *BAM*), instead of using the raw CSV generator, which I describe in my notes.

      I too noticed this about the Finance::Quote packages and mentioned it to Paul - The module that is Finance::Quote now is more the product of a lot of code that he inherited with the package than anything else. I had looked at helping out a bit and rewriting some code to make use of HTML::TokeParser but just haven't had the time.

      I will however direct Paul's attention to this thread and see what he thinks of the idea of making use of the CSV exports rather than the HTML pages with regard to Yahoo conversion figures - I can't however see any objections which he would have to such a change.

       

      perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'

        jryan and I have talked about me approaching Paul a couple times, but I would want to offer him more than "you're doing it wrong"

        This means that I'll have to reassemble and translate all of my notes about the "switches" that the server uses to offer data for the currency data, the exchange data AND the stock data. I might be able to read them and decipher them, but I wouldn't wish that on anyone.

        C-.

      G'day cacharbe,

      pjf here, in all his glory. *grin* I didn't actually realise that Yahoo provided a CSV of stock-quotes, although it's certainly not surprising. I agree that using a CSV interface is far superior to dissecting the HTML.

      I actually owe Finance::Quote a couple of good solid weeks of testing, applying patches, and making everything well and whole again.

      For what it's worth, I have a couple of patches that have been submitted which should remove F::Q's reliance upon Yahoo for currency information. This is a very good thing, as you may have noticed that Yahoo forbid you re-distributing their information to third parties by, say, putting it on a web-page. ;)

      For the record, I have no problems whatsoever in other people figuring out the best way to do things for my benefit. :)

      All the very best,

      Paul Fenwick
      Perl Training Australia

Re: Re: Re: Re: Yahoo Currency Exchange Interface
by sparkyichi (Deacon) on Dec 14, 2001 at 02:13 UTC
    Hmmm, I'd hate to disagree with you (I didn't vote you down), but I think it has a lot to do with why you are doing it. If you are writing it to learn more, then I think it is okay “reinvent the wheel.” I do however see your point that why do we need twenty WWW::Yahoo::Finance modules? I think that in this situation (practicing your Perl code) you would not want to submit your (duplicate) code to CPAN or something like that to provide a demonstration in futility. If your are working on a project, then it makes sense to use what is out there like you suggested. It saves you time and money plus there are thousand of Perl programmers for free QA on the CPAN modules. I think what generally happens here is people use Perl Monks to expand their knowledge and for constructive criticism on their code.

    B.T.W. I would be interested in one of “dozens of interesting projects for you to work on instead.” Perhaps we could discuss it tonight at the pdx.pm meeting.

    Sparky