Jumat, 15 Februari 2013

[smf_addin] Digest Number 2510

6 New Messages

Digest #2510
1a
Google extraction process by "Jim" buckleca
1b
Re: Google extraction process by "Randy Harmelink" rharmelink
1c
2a
Retrieving currency figures by "lawrence.leesh" lawrence.leesh
2b
Re: Retrieving currency figures by "Randy Harmelink" rharmelink
2c
Re: Retrieving currency figures by "lawrence.leesh" lawrence.leesh

Messages

Thu Feb 14, 2013 10:06 am (PST) . Posted by:

"Jim" buckleca

From your reply on "Google API with more variables" I've started to setup a spreadsheet using:

- to retrieve by ticker symbol:

=smfStrExtr(smfStrExtr(smfStrExtr(RCHGetWebData($D$2,1),"""t"" : """&$C4&";""","}"),""""&G$3&"""",","),"""","""")

...where:

$D$2 = the URL to retrieve the data
$C4 = which ticker symbol to extract
G$3 = which data item to extract (e.g. e, t, l_cur, ...)

In the original question it was asked how this example would be done:

http://www.google.com/finance/info?infotype=infoquoteall&q=BTU,JPM,AIG

You answered with the above and it works great.

My question – if I was to use this, would it be better to make the one call to the Google API (with multiple symbols) and then extract the data using smfStrExtr()? Maybe there's already a method for doing this?

My other option was to modify the above and run the URL for each symbol – but I was concerned that this would be a lot slower. Also if I run the URL with the many symbols I assume that the data will just be extracted from the "saved array".

I appreciate your recommendations.

Thanks

Thu Feb 14, 2013 11:34 am (PST) . Posted by:

"Randy Harmelink" rharmelink

On Thu, Feb 14, 2013 at 11:06 AM, Jim buckleca@yahoo.com> wrote:

> From your reply on "Google API with more variables" I've started to setup
> a spreadsheet using:
>
> - to retrieve by ticker symbol:
>
> =smfStrExtr(smfStrExtr(smfStrExtr(RCHGetWebData($D$2,1),"""t"" :
> """&$C4&";""","}"),""""&G$3&"""",","),"""","""")
>
> ...where:
>
> $D$2 = the URL to retrieve the data
> $C4 = which ticker symbol to extract
> G$3 = which data item to extract (e.g. e, t, l_cur, ...)
>
> In the original question it was asked how this example would be done:
>
> http://www.google.com/finance/info?infotype=infoquoteall&q=BTU,JPM,AIG
>
>
> You answered with the above and it works great.
>
> My question â€" if I was to use this, would it be better to make the one
> call to the Google API (with multiple symbols) and then extract the data
> using smfStrExtr()? Maybe there's already a method for doing this?
>

To which Google API are you referring?

My other option was to modify the above and run the URL for each symbol â€"
> but I was concerned that this would be a lot slower. Also if I run the URL
> with the many symbols I assume that the data will just be extracted from
> the "saved array".
>

One symbol per URL would definitely be slower. And, yes, the add-in does
save the results returned by the above URL, so any further calls to it
would use the saved copy instead of going to the Internet again.

Thu Feb 14, 2013 12:39 pm (PST) . Posted by:

"Jim" buckleca



Hi Randy,

Many thanks for your reply.I was referring to these messages in on your Links page:

Google.001 - Grabbing data items from the Google API
http://finance.groups.yahoo.com/group/smf_addin/message/20131

Your reply answered my questions as I was mostly concerned about calling the function many times.

My next test will be to string a bunch of cells together that represent the symbols:

http://www.google.com/finance/info?infotype=infoquoteall&q=BTU,JPM,AIG,ABC,DEF,XYZ,MMM,HIJ,KLM,HGF,LMN,PQR,JJJ

*not actual symbols

- so that there's only one actual call to the internet

--- In smf_addin@yahoogroups.com, Randy Harmelink wrote:
>
> On Thu, Feb 14, 2013 at 11:06 AM, Jim wrote:
>
> > From your reply on "Google API with more variables" I've started to setup
> > a spreadsheet using:
> >
> > - to retrieve by ticker symbol:
> >
> > =smfStrExtr(smfStrExtr(smfStrExtr(RCHGetWebData($D$2,1),"""t"" :
> > """&$C4&";""","}"),""""&G$3&"""",","),"""","""")
> >
> > ...where:
> >
> > $D$2 = the URL to retrieve the data
> > $C4 = which ticker symbol to extract
> > G$3 = which data item to extract (e.g. e, t, l_cur, ...)
> >
> > In the original question it was asked how this example would be done:
> >
> > http://www.google.com/finance/info?infotype=infoquoteall&q=BTU,JPM,AIG
> >
> >
> > You answered with the above and it works great.
> >
> > My question â€" if I was to use this, would it be better to make the one
> > call to the Google API (with multiple symbols) and then extract the data
> > using smfStrExtr()? Maybe there's already a method for doing this?
> >
>
> To which Google API are you referring?
>
> My other option was to modify the above and run the URL for each symbol â€"
> > but I was concerned that this would be a lot slower. Also if I run the URL
> > with the many symbols I assume that the data will just be extracted from
> > the "saved array".
> >
>
> One symbol per URL would definitely be slower. And, yes, the add-in does
> save the results returned by the above URL, so any further calls to it
> would use the saved copy instead of going to the Internet again.
>

Fri Feb 15, 2013 12:52 am (PST) . Posted by:

"lawrence.leesh" lawrence.leesh

Hi Randy

Is there a way to automatically retrieve currency figures from RCHGetElementNumber or any other method? I notice that google gives some financials in a foreign currency e.g. CNY and I need to automatically input the CNY/USD rate to convert the figures to USD.

thanks

LL

Fri Feb 15, 2013 1:19 am (PST) . Posted by:

"Randy Harmelink" rharmelink

If you mean currency rates, yes. Just use RCHGetYahooQuotes(). For example:

=RCHGetYahooQuotes("USDCNY=X","l1")

Or, are you referring to the currency type on the Google page?

=RCHGetWebData("http://www.google.com/finance?q=SHA%3A601607&fstype=ii","(except
for per share",3,-4)

On Fri, Feb 15, 2013 at 1:52 AM, lawrence.leesh lawrence.leesh@yahoo.com>wrote:

>
> Is there a way to automatically retrieve currency figures from
> RCHGetElementNumber or any other method? I notice that google gives some
> financials in a foreign currency e.g. CNY and I need to automatically input
> the CNY/USD rate to convert the figures to USD.
>

Fri Feb 15, 2013 2:51 am (PST) . Posted by:

"lawrence.leesh" lawrence.leesh

Got it. Thanks Randy.

--- In smf_addin@yahoogroups.com, Randy Harmelink wrote:
>
> If you mean currency rates, yes. Just use RCHGetYahooQuotes(). For example:
>
> =RCHGetYahooQuotes("USDCNY=X","l1")
>
> Or, are you referring to the currency type on the Google page?
>
> =RCHGetWebData("http://www.google.com/finance?q=SHA%3A601607&fstype=ii","(except
> for per share",3,-4)
>
> On Fri, Feb 15, 2013 at 1:52 AM, lawrence.leesh wrote:
>
> >
> > Is there a way to automatically retrieve currency figures from
> > RCHGetElementNumber or any other method? I notice that google gives some
> > financials in a foreign currency e.g. CNY and I need to automatically input
> > the CNY/USD rate to convert the figures to USD.
> >
>

Tidak ada komentar:

Posting Komentar