Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Yahoo Currency Exchange Interface

by cacharbe (Curate)
on Dec 14, 2001 at 01:49 UTC ( #131780=note: print w/ replies, xml ) Need Help??


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

Because I had already done 85% of the work before in the stock application, which didn't use the Finance::X because of earlier limitations to installing new modules (which have since been overcome), I wanted to see if the server would handle the Currency information as well, and I didn't think it necessary to learn how to use a new module for an hour's worth of work.

So I guess the answers are:

  • because I could
  • I wanted to
  • the sake of knowledge.

Is this somehow wrong?

C-.


Comment on Re: Re: Yahoo Currency Exchange Interface
Re: Re: Re: Yahoo Currency Exchange Interface
by merlyn (Sage) on Dec 14, 2001 at 01:51 UTC
    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

      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'

        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

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://131780]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-07-24 08:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls