bypassing finance::quote

Derek Atkins warlord at MIT.EDU
Mon Oct 6 11:53:15 EDT 2014


Hi,

Please remember to CC gnucash-devel on all responses using your mailer's
reply-to-list or reply-all functionality.  When you reply to me
personally you can get stuck in my personal mail-processing delays and
you don't benefit from all the expertice on the list.

Having said that.....

Rafael Lima <ragpl07 at gmail.com> writes:

> Is there any reason you didn't implement it as a PERL module behind
> F::Q?  Then it would *just work*.
> R- I didn't find an easy to get source for these quotes, so i needed
> to call a quote website (as bloomberg) and interprect the html, I
> spend a lot of time trying to do it in perl cuz im not used with it,
> so i just realized that i was wasting time and could do it in java in
> 5 minutes.

I'm not sure what your definition of "easy way" is..  Most of F::Q is a
bunch of screen scrapers.  So doing it in perl v java is just a matter
of language.

> "You would need to duplicate this functionality to convince GnuCash that
> F::Q exists"
>
> R-do you mean re-write the code? i just would like to know what
> structure is gnc looking for, so i could pretend have this structure

No, I mean re-implement the gnucash<->F::Q interfaces.  For example, you
would need to replace gnc-fq-helper with a wrapper around your java
application and have the input/output work "the same" so gnucash
*thinks* it's still talking to F::Q.

-derek

> On Fri, Oct 3, 2014 at 12:40 PM, Derek Atkins <warlord at mit.edu> wrote:
>> Hi,
>>
>> Rafael Lima <ragpl07 at gmail.com> writes:
>>
>> [snip]
>>> So, i develop a java program to do it, create a new source quote
>>> module that just call my java code and put it on the library and
>>> everything works fine.
>>
>> Is there any reason you didn't implement it as a PERL module behind
>> F::Q?  Then it would *just work*.
>>
>>> But i hate this situation, i've installed a perl interpreter just for
>>> use this library what doesn't have any function to my [is just a link]
>>>
>>>
>>> So i looked the code, looking for a hook for try insert my java code,
>>> but how im new at this code and not so expert cpp develop i would like
>>> some help:
>>>
>>> 1- i found the place where is called the function to check if
>>> finance::quote is installed... but i couldn't understand how it works
>>> LINE 19071 of swig-engine.c [pasted here
>>> http://paste.ofcode.org/38qxqQvM6aGFD3vxaQ2ekHK]
>>>
>>> seams that he is looking for something in a directory but what is
>>> exactally? i tried to reproduce the finance::quote directory
>>> estructure in my system and didn't work [maybe i forgot some file]
>>
>> You would need to duplicate this functionality to convince GnuCash that
>> F::Q exists.
>>
>>> 2-i found where the finance::quote code is called but i didn't
>>> understand the use of scm objects,
>>> LINE 290 of dialog-price-edit-db.c
>>> http://paste.ofcode.org/vwcWBUmDVMqM9VWdUdi5JE
>>>
>>> I realize that is a system call and hopefully there are some
>>> enviroiment  variables envolved [so i could change its value and call
>>> my own code =D] but i cant deep understand the code, can anyone help
>>> me?
>>
>> You will need to replicate the F::Q interface to GnuCash (see
>> gnc-fq-helper) and have that call into your program instead of F::Q.
>>
>>> sorry if i did something inconvenient and for my bad english...
>>>
>>>
>>> thanks for your attention
>>>
>>> I'm using gnucash 2.6.4 on a windows 7
>>
>> -derek
>>
>> --
>>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>>        Member, MIT Student Information Processing Board  (SIPB)
>>        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>>        warlord at MIT.EDU                        PGP key available

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-devel mailing list